lhs | R Documentation |
Draw a (random) Latin Hypercube (LH) sample of size n
from in
the region outlined by the provided rectangle
lhs(n, rect, shape=NULL, mode=NULL)
n |
Size of the LH sample |
rect |
Rectangle describing the domain from which the LH sample
is to be taken. The rectangle should be a |
shape |
Optional vector of shape parameters for the Beta distribution.
Vector of length equal to the dimension of the domain, with elements > 1.
If this is specified, the LH sample is proportional to a joint pdf formed by
independent Beta distributions in each dimension of the domain,
scaled and shifted to have support defined by |
mode |
Optional vector of mode values for the Beta distribution.
Vector of length equal to the dimension of the domain, with elements within
the support defined by |
The output is a matrix
with n
rows and
nrow(rect)
columns. Each of the n
rows represents
a sample point.
The domain bounds specified by the rows of rect
can
be specified backwards with no change in effect.
Robert B. Gramacy, rbg@vt.edu, and Matt Taddy, mataddy@amazon.com
Gramacy, R. B. (2020) Surrogates: Gaussian Process Modeling, Design and Optimization for the Applied Sciences. Boca Raton, Florida: Chapman Hall/CRC. (See Chapter 4.) https://bobby.gramacy.com/surrogates/
McKay, M. D., W. J. Conover and R. J. Beckman. (1979). A Comparison of Three Methods for Selecting Values of Input Variables in the Analysis of Output from a Computer Code, Technometrics 21: (pp. 239–245).
tgp.design
, dopt.gp
,
sens
# get and plot a 2-d LH design
s1 <- lhs(10, rbind(c(-2,3), c(0.5, 0.8)))
plot(s1)
# plot a grid to show that there is one sample
# in each grid location
abline(v=seq(-2,3,length=11), lty=2, col=3)
abline(h=seq(0.5,0.8,length=11), lty=2, col=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.