Learn R Programming

mc2d (version 0.2.0)

lhs: Random Latin Hypercube Sampling

Description

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

Usage

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

Value

A nsv x nsu matrix of random variates.

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.

Author

adapted from a code of Rob Carnell (library lhs)

See Also

mcstoc

Examples

Run this code
ceiling(lhs(runif, nsu=10, nsv=10)*10)

Run the code above in your browser using DataLab