I'm looking into Mathematica and I can't find if there is an instruction or a set of them that can perform the Latin Hypercube Sampling, given variable, their interval and possibly relation between them (like a always greater than b)

thank you!

  • 1
    $\begingroup$ Perhaps you can enlighten the masses as to what Latin Hypercube Sampling is?! $\endgroup$
    – Igor Rivin
    Commented Sep 26, 2014 at 19:36
  • 2
    $\begingroup$ Latin hypercube sampling is a statistical method for generating a sample of plausible collections of parameter values from a multidimensional distribution When sampling a function of N variables, the range of each variable is divided into M equally probable intervals. M sample points are then placed to satisfy the Latin hypercube requirements; note that this forces the number of divisions, M, to be equal for each variable. LHS ensures that the ensemble of random numbers is representative of the real variability $\endgroup$
    – Yyrkoon
    Commented Sep 26, 2014 at 19:45
  • 1
    $\begingroup$ I am almost sure that there are LHS implementations for both Matlab and R – $\endgroup$ Commented Sep 26, 2014 at 20:07
  • $\begingroup$ Matlab definitely has it. I have not found anyone using Mathematica that has an LHS code. I checked Demonstrations. I'm thinking of writing one. $\endgroup$
    – user29248
    Commented May 5, 2015 at 4:58

1 Answer 1


You can check the next link:


I check the algorithm against the original source, it works!

  • $\begingroup$ Interesting. Glad someone thought to do this beforehand. Good Question!! $\endgroup$ Commented May 11, 2016 at 21:01
  • $\begingroup$ In 2022, the location has changed to here. $\endgroup$
    – Alan
    Commented Mar 28, 2022 at 15:55

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.