createInitialSample: Create Initial Sample

Description Usage Arguments Details Value Examples

View source: R/createInitialSample.R

Description

Convenient helper function, which creates an initial sample - either based on random (uniform) sampling or using latin hypercube sampling.

Usage

1
createInitialSample(n.obs, dim, control)

Arguments

n.obs

[integer(1)]
Number of observations.

dim

[integer(1)]
Number of dimensions.

control

[list]
Control argument. For further information refer to the details.

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:

Value

[matrix].
A matrix, consisting of n.obs rows of dim-dimensional observations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# (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)

flacco documentation built on June 20, 2017, 9:06 a.m.

Search within the flacco package
Search all R packages, documentation and source code