<< scidoe_fullfact Designs scidoe_star >>

Scidoe >> Scidoe > Designs > scidoe_lhsdesign

scidoe_lhsdesign

Latin Hypercube Sampling

Calling Sequence

H = scidoe_lhsdesign(s,n)
H = scidoe_lhsdesign(...,"criterion","center")
H = scidoe_lhsdesign(...,"criterion","maximin")
H = scidoe_lhsdesign(...,"criterion","correlation")
H = scidoe_lhsdesign(...,"criterion","centermaximin")
H = scidoe_lhsdesign(...,"iterations",k)

Parameters

s :

a 1-by-1 matrix of doubles, integer value, s>=1, the number of variables

n :

a 1-by-1 matrix of doubles, integer value, n>=1, the number of points

k :

a 1-by-1 matrix of doubles, integer value, k>=1, the number of iterations in the maximin algorithm

H :

a n-by-s matrix of doubles, the LHS sampling

Description

Computes a Latin Hypercube Sampling

This function changes the state of the grand uniform random number generator.

Examples

// Compute a random LHS with 2 variables and 5 points
H = scidoe_lhsdesign(2,5)
scf();
scidoe_plotlhs(H)
xtitle("LHS design","X1","X2")

// Compute a centered LHS design
H = scidoe_lhsdesign(2,5,"criterion","center")
scf();
scidoe_plotlhs(H)
xtitle("Centered LHS design","X1","X2")

// Compute a maximin LHS design
H = scidoe_lhsdesign(2,5,"criterion","maximin")
scf();
scidoe_plotlhs(H)
xtitle("Maximin LHS design","X1","X2")

// Compute a correlation LHS design
H = scidoe_lhsdesign(2,5,"criterion","correlation");
scf();
scidoe_plotlhs(H)
xtitle("Correlation LHS design","X1","X2")

// Compute a maximin LHS design, with 100 iterations
H = scidoe_lhsdesign(2,5,"criterion","maximin""iterations",100)
// d is larger when k increases
d=min(scidoe_pdist(H))
scf();
scidoe_plotlhs(H)
xtitle("Maximin LHS design","X1","X2")

// A maximin centered LHS
H= scidoe_lhsdesign(2,5,"criterion","centermaximin","iterations",10);
scf();
scidoe_plotlhs(H)

// See Maximin LHS designs when k increases.
// The 5 points seems to go away from the center,
// which increases the minimum distance between the points.
grand("setsd",0);
H1 = scidoe_lhsdesign(2,5,"criterion","maximin","iterations",2);
grand("setsd",0);
H2 = scidoe_lhsdesign(2,5,"criterion","maximin","iterations",100);
d1 = min(scidoe_pdist(H1));
d2 = min(scidoe_pdist(H2));
t1=msprintf("Maximin LHS - k=2, dmin=%f",d1);
t2=msprintf("Maximin LHS - k=100, dmin=%f",d2);
scf();
subplot(1,2,1)
scidoe_plotlhs(H1)
xtitle(t1,"X1","X2")
subplot(1,2,2)
scidoe_plotlhs(H2)
xtitle(t2,"X1","X2")

// See various correlation LHS designs
grand("setsd",0);
H1 = scidoe_lhsdesign(2,5,"criterion","correlation","iterations",2);
R=corrcoef(H1);
corr1=max(abs(R(R<>1)));
grand("setsd",0);
H2 = scidoe_lhsdesign(2,5,"criterion","correlation","iterations",100);
R=corrcoef(H2);
corr2=max(abs(R(R<>1)));
// We have corr2 < corr1.
t1=msprintf("Maximin LHS - k=2, maxcorrelation=%f",corr1);
t2=msprintf("Maximin LHS - k=100, maxcorrelation=%f",corr2);
scf();
subplot(1,2,1)
scidoe_plotlhs(H1)
xtitle(t1,"X1","X2")
subplot(1,2,2)
scidoe_plotlhs(H2)
xtitle(t2,"X1","X2")

See also

Bibliography

McKay, M.D. Beckman, R.J. Conover, W.J. (May 1979). "A Comparison of Three Methods for Selecting Values of Input Variables in the Analysis of Output from a Computer Code" Technometrics (American Statistical Association) 21 (2): 239–245.

http://en.wikipedia.org/wiki/Latin_hypercube_sampling

http://www.mathworks.com/help/toolbox/stats/lhsdesign.html

Authors


Report an issue
<< scidoe_fullfact Designs scidoe_star >>