LCVT_DATASET is a MATLAB program which computes a Latin Hypercube in M dimensions, with N points, using a CVT dataset as the initial estimate, and can write it to a file.
A Latin Square dataset is typically a two dimensional dataset of N points in the unit square, with the property that, if both the x and y axes are divided up into N equal subintervals, exactly one dataset point has an x or y coordinate in each subinterval. Latin squares can easily be extended to the case of M dimensions, and may be pedantically called Latin Hypersquares or Latin Hypercubes in such a case. Statisticians like Latin Squares, as do experiment designers, and and people who need to approximate scalar functions of many variables.
The fact that the projection of a Latin Square dataset onto any coordinate axis is either exactly evenly spaced, or approximately so (depending on the algorithm), turns out to be an attractive feature for many uses.
However, a CVT dataset in a regular domain, such as the unit hypercube, has the tendency for the projections of the points to cluster together in any coordinate axis. This program is mainly an attempt to explore whether a dataset can be computed using techniques similar to those of a CVT, but with the constraint (whether imposed or expected) that the point projections do not clump up.
The approach used here is quite simple. First we compute a CVT in M dimensions, comprising N points. We assume that the bounding region is the unit hypercube. We are now going to adjust the coordinates of the points to achieve the Latin Hypercube property. For each coordinate direction, we simply sort the points by that coordinate, and then overwrite the original values by the values we'd expect to get for a centered Latin Hypercube, namely, 1/(2*N), 3/(2*N), ..., (2*N-1)/(2*N).
Now this process guarantees that we get a Latin Hypercube. Our hope is that the process of adjusting the point coordinates does not too severely damage the nice dispersion properties inherent in the CVT point placement.
An earlier version of this program was "very" interactive, allowing the user to enter input in any order. This turned out to be a little too confusing. The new version of the program asks the user for input in a strict order. If you find this procedure too restrictive, you can try out the old program.
Briefly the user needs to specify the following:
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
LCVT_DATASET is available in a C++ version and a FORTRAN90 version and a MATLAB version.
CVT, a MATLAB library which can compute a Centroidal Voronoi Tessellation (CVT).
CVT_DATASET, a MATLAB program which can specify and compute a Centroidal Voronoi Tessellation (CVT).
FAURE_DATASET, a MATLAB program which creates a Faure quasirandom dataset;
GRID_DATASET, a MATLAB program which creates a grid sequence and writes it to a file.
LATIN_CENTER_DATASET, a MATLAB program which creates a Latin Center Hypercube dataset;
LATIN_EDGE_DATASET, a MATLAB program which creates a Latin Edge Hypercube dataset;
LATIN_RANDOM_DATASET, a MATLAB program which creates a Latin Random Hypercube dataset;
LCVT, a MATLAB library which is used by LCVT_DATASET; a compiled copy of that library must be available to build the program.
LCVT, a dataset which contains a collection of sample LCVT datasets created by LCVT_DATASET.
NIEDERREITER2_DATASET, a MATLAB program which creates a Niederreiter quasirandom dataset with base 2;
NORMAL_DATASET, a MATLAB program which generates a dataset of multivariate normal pseudorandom values and writes them to a file.
SOBOL_DATASET, a MATLAB program which computes a Sobol quasirandom sequence and writes it to a file.
UNIFORM_DATASET, a MATLAB program which generates a dataset of uniform pseudorandom values and writes them to a file.
VAN_DER_CORPUT_DATASET, a MATLAB program which creates a van der Corput quasirandom sequence and writes it to a file.
Example 1 is a dataset of N=85 points with spatial dimension M=2, using UNIFORM initialization and sampling, and 10,000 sample points:
Example 2 is a dataset of N=85 points with spatial dimension M=2, using RAND initialization and sampling, and 250000 sample points:
Example 3 is a dataset of N=200 points with spatial dimension M=7, using UNIFORM initialization and sampling, and 20,000 sample points, 5 CVT iterations and 2 Latinization iterations:
You can go up one level to the MATLAB source codes.