[R] identifying and drawing from T distribution

ivo welch ivo.welch at anderson.ucla.edu
Sat Mar 16 02:58:22 CET 2013


dear R experts:

fitdistr suggests that a t with a mean of 1, an sd of 2, and 2.6
degrees of freedom is a good fit for my data.

now I want to draw random samples from this distribution.    should I
draw from a uniform distribution and use the distribution function
itself for the transform, or is there a better way to do this?   there
is a non-centrality parameter ncp in rt, but one parameter ncp cannot
subsume two (m and s), of course.  my first attempt was to draw
rt(..., df=2.63)*s+m, but this was obviously not it.

advice appreciated.

/iaw

----
Ivo Welch (ivo.welch at gmail.com)
http://www.ivo-welch.info/



More information about the R-help mailing list