View source: R/optimizer_lhs.R
| lhs_sample | R Documentation |
Draws a Latin hypercube sample of parameter sets within user-specified
ranges and returns them on the transformed scale on which
optimizer works (see transform_pars). Each
parameter range is divided into n strata of equal width on the
sampling scale and every stratum is sampled exactly once per parameter.
lhs_sample(n, lower, upper, sampling_scale = "transformed")
n |
Number of parameter sets to draw. |
lower |
Vector with the lower bounds of the parameters on the original (untransformed) scale. If the vector is named, the names are used for the columns of the result. |
upper |
Vector with the upper bounds of the parameters on the original (untransformed) scale. |
sampling_scale |
The scale on which the strata have equal width. Either a single value used for all parameters, or one value per parameter:
|
A matrix with n rows and length(lower) columns
with the sampled parameter sets on the transformed scale. Use
untransform_pars to obtain the values on the original scale.
Rampal S. Etienne
optimizer_lhs
set.seed(42)
trpars <- lhs_sample(n = 5,
lower = c(lambda = 0.1, mu = 0, K = 10),
upper = c(lambda = 2, mu = 1, K = 1000),
sampling_scale = c('transformed', 'transformed', 'log'))
untransform_pars(trpars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.