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)
"print"(x, ...)
tell(x, y = NULL, ...)
"tell"(x, y, res.names = NULL, nboot = 0, ...)NULL, no function is run and the object generated is incomplete, see also the tell method. NOTE: You should manually export ALL objects required for the model to run, including the model
function itself. See the help on clusterExport on package parallel for
details.
N is generated from the desired quantile distribution functionsThe 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 using code based on the prcc
function from the "sensitivity" package.
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.
tell and ask are S3 generic methods for decoupling
simulations and sensitivity measures estimations in the package
`sensitivity'. In general, they are
not used by the end-user for a simple R model, but rather for an
external computational code. The LHS object implements only the
tell method. For help on the other methods, see the help
pages on the `sensitivity' package.
Chalom, A. and Prado, P.I.K.L. 2012. Parameter space exploration of ecological models arXiv:1210.6278 [q-bio.QM]
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))
## Not run:
# new.cluster <- parallel::makePSOCKcluster(c("localhost", "localhost"))
# clusterLHS <- LHS(model=function(x) x[,1]/x[,2], factors=2, N=100, cl = new.cluster)
# stopCluster(new.cluster)
# ## End(Not run)
Run the code above in your browser using DataLab