0
$\begingroup$

I'm new to Latin hypercube sampling, and am trying to understand if the somewhat odd sampling that results from the Matlab function lhsdesign is a limitation of the particular algorithm or something deeper within LHS, which I've failed to realize from the literature. I suppose the fact that the results are SO bad is what makes me doubt that this is Matlab's mistake, though I'm almost certain it is. A toy example:

n=3;                %dimensions
p=1e5;              %samples
s=lhsdesign(n,p);   %default algorithm maximizes min distance between samples
figure
plotmatrix(s.')
figure
scatter3(s(1,:),s(2,:),s(3,:),'.')
xlabel('1'),ylabel('2'),zlabel('3')

The following figures result (first figure is with 1e4 samples so that individual points are visible):
enter image description here enter image description here

As is quite visible, there are p block-gaps along the main diagonal (testing with other p confirms this). I understand that it's easy to make an LHS that isn't space-filling (e.g. the identity matrix), but Matlab's explanation of the algorithm,although brief, doesn't suggest this behavior should arise.

$\endgroup$

1 Answer 1

0
$\begingroup$

You (I) have specified n and p backward, thus the plots are for 3 samples of a 1E5 dimensional space, and the gaps correspond to LHS doing exactly what it's designed to do. In short, I'm an idiot.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.