createInitialSample {flacco} | R Documentation |
Create Initial Sample
Description
Convenient helper function, which creates an initial sample - either based on random (uniform) sampling or using latin hypercube sampling.
Usage
createInitialSample(n.obs, dim, control)
Arguments
n.obs |
[ |
dim |
[ |
control |
[ |
Details
Per default, this function will produce n.obs
observations of size
dim
in the range from 0 to 1. If you want to create a more specific
initial sample, the following control arguments might be helpful:
init_sample.type
: Should the initial sample be created based on random uniform sampling ("random"
) or on a latin hypercube sample ("lhs"
)? The default is"random"
.init_sample.lower
: The lower bounds of the initial sample. Either a vector of sizedim
or a scalar (if all lower bounds are identical). The default is0
.init_sample.upper
: The upper bounds of the initial sample. Either a vector of sizedim
or a scalar (if all upper bounds are identical). The default is1
.
Value
[matrix
].
A matrix, consisting of n.obs
rows of dim
-dimensional
observations.
Examples
# (1) create a simple initial sample:
X = createInitialSample(300, 5)
summary(X)
# (2) create a more specific initial sample:
ctrl = list(init_sample.type = "lhs",
init_sample.lower = c(-5, 2, 0),
init_sample.upper = 10)
X = createInitialSample(200, 3, control = ctrl)
summary(X)