Sampling from a T-distribution

Hi,

Dose anyone know if it is possible to sample from a T-distribution in Phoenix?

Sampling from Normal distributions and uniform distribution seem straightforward but I don’t know an easy way to sample from a T-distribution - hoping there might be some simple general code…

(I am trying to run a Monte Carlo simulation and the distribution of one of the parameters is best described by the T-distribution).

Cheers,

Douglas

Dear Douglas

I am attaching a formula you can try.

You need to simulate k+1 normal random numbers with mean 0 and variance 1(you can do that with NLME) and then use the attached formula which will give a t distribution random sample with k degree of freedom. Try it and let me know.

BEST

SERGE

t_distirbution.docx (12.7 KB)

other useful links that show the links between chi square , normal and t distributions

http://www.amath.nchu.edu.tw/member/room/605Lecture/Lecture%2005_addendum_Chisquare,t%20and%20F%20distributions.PDF

http://www.statisticsmentor.com/2012/08/20/relationship-of-t-distribution-to-normal-and-chi-square/

Thanks for the replies,

Serge, your approach worked perfectly!

Thanks again,

Douglas

Great to hear.

best

Serge