Skip to content

Commit 92cdf97

Browse files
committed
update description for mvtnorm sampling + add warning
1 parent 0b6a3c9 commit 92cdf97

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: irxforge
22
Title: Forging data for pharmacometric analyses
3-
Version: 0.0.0.9002
3+
Version: 0.0.0.9003
44
Authors@R: c(
55
person("Ron", "Keizer", email = "ron@insight-rx.com", role = c("cre", "aut")),
66
person("Michael", "McCarthy", email = "michael.mccarthy@insight-rx.com", role = "ctb"),

R/sample_covariates_mvtnorm.R

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
#' Sample covariates from multivariate normal distributions
22
#'
33
#' Samples from a multivariate normal distribution either derived from observed
4-
#' data or specified directly via `means` plus a covariance matrix (`sigma`) or
5-
#' standard deviations (`sd`).
4+
#' `data` or specified directly via `means` plus a covariance matrix (`sigma`)
5+
#' or standard deviations (`sd`).
6+
#'
7+
#' The `conditional` argument` can be specified only when data is used as input
8+
#' (and not with `means` and `sigma or `sd``). If `conditional`` is used in
9+
#' conjuction with `data``, it will first downsample the provided dataset to
10+
#' include only patients that match the conditional. After that, it will get
11+
#' the covariance matrix from the downsampled dataset, and draw samples from
12+
#' it. It is therefore possible that, in contrast to e.g. bootstrap sampling,
13+
#' samples are drawn that are outside of the min/max given in the conditional.
614
#'
715
#' @param data data.frame (n x p) containing the original, observed,
816
#' time-invariant covariates (ID should not be included) that will be used to
@@ -71,6 +79,9 @@ sample_covariates_mvtnorm <- function(
7179
if (!is.null(data)) {
7280
warning("`data` is ignored when `means` is provided.")
7381
}
82+
if(!is.null(conditional)) {
83+
warning("`conditional` is ignored when `means` is provided.")
84+
}
7485
if (is.null(sigma) && is.null(sd)) {
7586
stop("When `means` is supplied, either `sigma` or `sd` must also be provided.")
7687
}

man/sample_covariates_mvtnorm.Rd

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)