lhs.design {DoE.wrapper} | R Documentation |
Functions for comfortably accessing latin hypercube sampling designs from package lhs, which are useful for quantitative factors with many possible levels. In particular, they can be used in computer experiments. The designs are random samples.
lhs.design(nruns, nfactors, type="optimum", factor.names=NULL, seed=NULL, digits=NULL, ...) lhs.augment(lhs, m=1, type="optAugment", seed=NULL, ...)
nruns |
number of runs in the latin hypercube sample |
nfactors |
number of factors in the latin hypercube sample |
type |
character string indicating the type of design or augmentation method;
defaults are “optimum” for lhs.design and “optAugment”
for lhs.augment ;both functions call the functions named typeLHS from package lhs in order to fulfill their task; possible types for lhs.design are
genetic , improved , maximin , optimum , random ,
possible types for lhs.augment are augment , optSeeded , or optAugment .see the respective functions from package lhs |
seed |
seed for random number generation; latin hypercube samples from package lhs are random samples. Specifying a seed makes the result reproducible. |
factor.names |
list of scale end values for each factor; names are used as variable names; if the list is not named, the variable names are X1, X2 and so forth; the original unit cube calculated by package lhs (scale ends 0 and 1 for each variable) is rescaled to the values given in factor.names |
digits |
digits to which the design columns are rounded; one single value
(the same for all factors) or a vector of length nfactors ;note that the rounding is applied after generation of the design on the actual data scale, i.e. the unit cube generated by the functions from package lhs is NOT rounded |
lhs |
design generated by function lhs.design (class design ,
of type lhs |
m |
integer number of additional points to add to design lhs (note, however,
that optSeeded does not necessarily preserve all original runs!) |
... |
additional arguments to the functions from package lhs;
refer to their documentation (functions for generating lhs designs:
randomLHS , geneticLHS ,
improvedLHS , maximinLHS ,
optimumLHS ; functions for augmenting lhs designs:
augmentLHS ,
optSeededLHS ,
optAugmentLHS )
|
Function lhs.design
creates a latin hypercube sample,
function lhs.augment
augments an existing latin hypercube sample (or in case of
type optSeeded
takes the existing sample as the starting point but potentially modifies it).
In comparison to direct usage of package lhs, the functions add the possibility
of recoding lhs samples to a desired range, and they embed the lhs designs into
class design
.
Range coding is based on the recoding facility from package rsm and the
factor.names
parameter used analogously to packages DoE.base and FrF2.
The lhs designs are useful for quantitative factors, if it is considered desirable to uniformly distribute design points over a hyperrectangular space. This is e.g. considered interesting for computer experiments, where replications of the same settings are often useless.
Both functions return a data frame of S3 class design
with attributes attached.
The data frame contains the experimental settings as recoded to the scale ends defined in factor.names (if given),
rounded to the number of digits given in digits
(if given).
The experimental factors in the matrix desnum
attached as attribute desnum
contain the
design in the unit cube (all experimental factors ranging from 0 to 1) as
returned by package lhs
.
Function lhs.augment
preserves additional variables (e.g. responses) that
have been added to the design lhs
before augmenting. Note, however, that
the response data are NOT used in deciding about which points to augment the design with.
The attribute run.order
is not very useful for this type of design, as there is no standard order.
It therefore is present for formal reasons only and contains three identical columns of 1,2,...,nruns. In case of
lhs.augment
, if the design to be augmented had been reordered before, the augmented design preserves this reorder
and also the respective numbering of the design.
The attribute design.info
is a list of various design properties, with type resolving to “lhs”.
In addition to the standard list elements (cf. design
), the subtype
element indicates the type of latin hypercube designs and possibly additional augmentations, the element
quantitative
is a vector of nfactor
logical TRUEs,
and the digits
elements indicates the digits to which the data were rounded.
(Note that randomize
is always TRUE, replications
is always 1 and repeat.only
is always FALSE;
these elements are only present to fulfill the formal requirements for class design
.)
This package is currently under intensive development. Substantial changes are to be expected in the near future.
Ulrike Groemping
Beachkofski, B., Grandhi, R. (2002) Improved Distributed Hypercube Sampling. American Institute of Aeronautics and Astronautics Paper 1274.
Stein, M. (1987) Large Sample Properties of Simulations Using Latin Hypercube Sampling. Technometrics. 29, 143–151.
Stocki, R. (2005) A method to improve design reliability using optimal Latin hypercube sampling. Computer Assisted Mechanics and Engineering Sciences 12, 87–105.
See Also lhs-package
, FrF2
,
oa.design
, pb
plan <- lhs.design(20,7,"maximin",digits=2) plan plot(plan) cor(plan) y <- rnorm(20) r.plan <- add.response(plan, y) plan2 <- lhs.augment(plan, m=10) plot(plan2) cor(plan2) plan3 <- lhs.design(20,4,"random", factor.names=list(c(15,25), c(10,90), c(0,120), c(12,24)), digits=2) plot(plan3) cor(plan3) plan4 <- lhs.design(20,4,"optimum", factor.names=list(torque=c(10,14),friction=c(25,35), temperature=c(-5,35),pressure=c(20,50)),digits=2) plot(plan4) cor(plan4)