Statistics Toolbox | ![]() ![]() |
Generate a latin hypercube sample
Syntax
X = lhsdesign(n,p)
X = lhsdesign(...,'smooth','off')
X = lhsdesign(...,'criterion','c
')
X = lhsdesign(...,'iterations',k)
Description
X = lhsdesign(n,p)
generates a latin hypercube sample X
containing n
values on each of p
variables. For each column, the n
values are randomly distributed with one from each interval (0,1/n)
, (1/n,2/n)
, ..., (1-1/n,1)
, and they are randomly permuted.
X = lhsdesign(...,'smooth','off')
produces points at the midpoints of the above intervals: 0.5/n
, 1.5/n
, ..., 1-0.5/n
. The default is 'on'
.
X = lhsdesign(...,'criterion','
iteratively generates latin hypercube samples to find the best one according to the criterion 'c
')
c
', which can be:
'none' |
No iteration |
'maximin' |
Maximize minimum distance between points |
'correlation' |
Reduce correlation |
X = lhsdesign(...,'iterations',k)
iterates up to k
times in an attempt to improve the design according to the specified criterion. Default is K = 5
.
Latin hypercube designs are useful when you need a sample that is random but that is guaranteed to be relatively uniformly distributed over each dimension.
See Also
![]() | leverage | lhsnorm | ![]() |