N
is generated from the desired quantile distribution functions The following methods are currently supported for generating the LHS: random LHS and
Huntington & Lyrintzis method for correcting the correlation matrix to be similar
to the prescribed by the option COR
(see the arguments for description).
The specified model
is run with the data from the LHS. If repetitions
is set to more than one, the model will be run several times for each data point.
Partial rank correlation coefficients are estimated.
When the LHS function is called with no model (i.e., with argument
model=NULL
), it generates an incomplete object storing the Latin
Hypercube samples, and allowing the user to run the simulation
model independently. The method tell
allows to pass the simulation
results to the incomplete object.
The
LHS(model = NULL, factors, N, q = NULL, q.arg = NULL, res.names = NULL,
method=c("HL", "random"), opts=list(), nboot = 0, repetitions=1,
cl = NULL)
## S3 method for class 'LHS':
tell(x, y, res.names = NULL, nboot = 0, \dots)
## S3 method for class 'LHS':
print(x, \dots)
NULL
, no function is run and the object generated is incomplete, see also the tell
method.completeLHS <- LHS(model=function(x) x[,1]+x[,2]*x[,3], factors=3, N=20)
incompleteLHS <- LHS(factors=5, N=30)
incompleteLHS <- tell(incompleteLHS, seq(1,30))
library(parallel)
new.cluster = makePSOCKcluster(c("localhost", "localhost"))
clusterLHS <- LHS(model=function(x) x[,1]/x[,2], factors=2, N=100, cl = new.cluster)
stopCluster(new.cluster)
Run the code above in your browser using DataLab