parameterSets {hydromad} | R Documentation |
Generate parameter sets from given ranges, with chosen sampling scheme.
parameterSets(par.ranges, samples, method = c("latin.hypercube", "random", "all.combinations"))
par.ranges |
A named list of (numeric) parameter values. Each element can be:
|
samples |
Number of samples to generate. In the
|
method |
the sampling scheme; see Details. |
Method "latin.hypercube"
generates a regular sequence for each
free parameter range (using quantile
and
ppoints
), and a repeated sequence for each fixed
parameter set. Each of these sequences is then randomly permuted. For
the special case of samples = 1
, the mean of each range is
returned.
Method "random"
generates uniform random values in each free
parameter range, and random samples from each fixed parameter set.
Method "all.combinations"
generates a regular sequence for each
free parameter range, and keeps each fixed parameter set as given. All
combinations of these values are then calculated (using
expand.grid
). The length of the free parameter sequences is
chosen such that the total number of results does not exceed
samples
. However, if fixed parameter sets are given, the
number of combinations of these may exceed samples
, and then
any free parameters will be fixed at their mean values.
the result is a data.frame
, with named columns for each
parameter in par.ranges
. Each row represents one parameter set.
Felix Andrews felix@nfrac.org
sample
,
quantile
pars <- list(a = 1, b = 0:1, c = c(1,10), d = c(-2,-4,-8)) parameterSets(pars, 10, method = "random") parameterSets(pars, 10, method = "latin") parameterSets(pars, 10, method = "all.combinations") parameterSets(pars, 20, method = "all.combinations")