lhs function

Random Latin Hypercube Sampling

Random Latin Hypercube Sampling

Creates a Latin Hypercube Sample (LHS) of the specified distribution.

lhs(distr="runif", nsv=ndvar(), nsu=ndunc(), nvariates=1, ...)

Examples

ceiling(lhs(runif, nsu=10, nsv=10)*10)

Arguments

  • distr: The function for generating random sample or its name. If distr is "rdist", the function "qdist" must be the quantile function of this distribution with argument p as a vector of probabilities, as all univariates distributions of the stat

    library.

  • 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.

Returns

A nsv x nsu matrix of random variates.

Author(s)

adapted from a code of Rob Carnell (library lhs )

See Also

mcstoc

Note

The resulting lhs is in fact a latin hypersquare sampling: the lhs is provided only in the first 2 dimensions.

It is not possible to send truncated distribution with rtrunc. Use mcstoc for this purpose, with lhs=TRUE and rtrunc=TRUE .

The ... arguments will be recycled.

  • Maintainer: Regis Pouillot
  • License: GPL (>= 2)
  • Last published: 2024-06-05

Useful links