Learn R Programming

flacco (version 1.0)

createInitialDesign: Create Initial Design

Description

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

Usage

createInitialDesign(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.

Value

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

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 design, the following control arguments might be helpful:
  • init_design.type
: Should the initial design be created based on random uniform sampling ("random") or on a latin hypercube sample ("lhs")? The default is "random". init_design.lower: The lower bounds of the initial design. Either a vector of size dim or a scalar (if all lower bounds are identical). The default is 0. init_design.upper: The upper bounds of the initial design. Either a vector of size dim or a scalar (if all upper bounds are identical). The default is 1.

Examples

Run this code
# (1) create a simple initial design:
X = createInitialDesign(300, 5)
summary(X)

# (2) create a more specific initial design:
ctrl = list(init_design.type = "lhs",
  init_design.lower = c(-5, 2, 0),
  init_design.upper = 10)
X = createInitialDesign(200, 3, control = ctrl)
summary(X)

Run the code above in your browser using DataLab