Norm | R Documentation |
Generates random parameter sets that are (multi)normally distributed.
Norm(parMean, parCovar, parRange = NULL, num)
parMean |
a vector, with the mean value of each parameter. |
parCovar |
the parameter variance-covariance matrix. |
parRange |
the range (min, max) of the parameters, a matrix or a data.frame with one row for each parameter, and two columns with the minimum (1st) and maximum (2nd) column. |
num |
the number of random parameter sets to generate. |
Function Norm
, draws parameter sets from a multivariate normal
distribution, as specified through the mean value and the
variance-covariance matrix of the parameters. In addition, it is
possible to impose a minimum and maximum of each parameter, via
parRange
. This will generate a truncated distribution. Use
this for instance if certain parameters cannot become negative.
a matrix with one row for each generated parameter set, and one column per parameter.
For function Norm
to work, parCovar
must be a valid
variance-covariance matrix. (i.e. positive definite). If this is not the
case, then the function will fail.
Karline Soetaert <karline.soetaert@nioz.nl>
Unif
for uniformly distributed random parameter sets.
Latinhyper
to generates parameter sets using
latin hypercube sampling.
Grid
to generate random parameter sets arranged on a regular
grid
rnorm
the R-default for generating normally distributed random
numbers.
## multinormal parameters: variance-covariance matrix and parameter mean
parCovar <- matrix(data = c(0.5, -0.2, 0.3, 0.4, -0.2, 1.0, 0.1, 0.3,
0.3, 0.1, 1.5, -0.7, 1.0, 0.3, -0.7, 4.5), nrow = 4)
parCovar
parMean <- 4:1
## Generated sample
Ndist <- Norm(parCovar = parCovar, parMean = parMean, num = 500)
cov(Ndist) # check
pairs(Ndist, main = "normal")
## truncated multinormal
Ranges <- data.frame(min = rep(0, 4), max = rep(Inf, 4))
pairs(Norm(parCovar = parCovar, parMean = parMean, parRange = Ranges,
num = 500), main = "truncated normal")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.