| lhs | R Documentation |
Creates a Latin Hypercube Sample (LHS) from the specified distribution.
lhs(distr = "runif", nsv = ndvar(), nsu = ndunc(), nvariates = 1, ...)
distr |
the function for generating random samples, or its name as a character string. If ‘distr’ is ‘"rdist"’, the quantile function ‘"qdist"’ must exist with argument ‘p’ as a vector of probabilities. |
nsv |
the number of rows of the final matrix. |
nsu |
the number of columns of the final matrix. |
nvariates |
the number of variates. |
... |
all arguments to be passed to ‘distr’ except the size of the sample. |
A vector of ‘nsv x nsu x nvariates’ random variates, stratified along the variability dimension (‘nsv’) for each column.
The resulting LHS is a latin hypersquare sampling: the LHS structure is provided
only in the first 2 dimensions.
It is not possible to use truncated distributions directly with rtrunc.
Use mcstoc with ‘lhs=TRUE’ and ‘rtrunc=TRUE’ for that purpose.
The ... arguments will be recycled.
Adapted from a code by Rob Carnell (package lhs).
mcstoc
ceiling(lhs(runif, nsu=10, nsv=10) * 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.