2

I need to extract 10000 samples from a beta distribution with the help of Latin hypercube. the lhsnorm command only helps in case of a normal distribution. I also could not find much under lhsdesign. How should I do this?

Thanks in advance.

EBH
  • 10,350
  • 3
  • 34
  • 59

1 Answers1

0

You can use lhsdesign to get a set of uniformly distributed numbers, then using Inverse transform sampling method you convert them to beta distribution. For example:

X = lhsdesign(10000,1);
Y = betainv(X,5,2);
histogram(Y)

lhs beta

EBH
  • 10,350
  • 3
  • 34
  • 59
  • thank you very much EBH for answering. However I dont quite follow the result here. the command "betainv" gives me the probability of numbers in X occuring. It doesnt really give me samples does it? the resulting diagramm on the other hand, seems correct. – Kleiner Maverick Jan 25 '17 at 10:53
  • @KleinerMaverick, **have a look the link above**. The idea of taking the inverse of the beta distribution it to convert uniform distribution to beta. `lhsdesign` generates numbers from U~(0,1), and you use the CDF of another distribution (which is also between 0 to 1 ), beta in this case, to get the corresponding number in it. In other words, using `lhsdesign` you randomize the probabilities to get values from beta, and with `betainv` you get the values that have this probability. – EBH Jan 25 '17 at 13:31