[R] identifying and drawing from T distribution

ivo welch ivo.welch at anderson.ucla.edu
Sat Mar 16 22:42:38 CET 2013


actually, I had it right all along.  that is,

m<- runif(); s<- runif(); df<-runif()*10+1  # get some
parameters...any parameters
x <- rt( 100000, df )*s + m  # create random draws
library(MASS)
fitdistr(x, "t")  # confirm properties

will work.  (josh suggested working with the skewness parameter, ncp,
which solves a different problem.)

I believe that I was confused, because fitdistr will not necessarily
assign the sample mean to be its maximum-likelihood estimate of the
population mean.

/iaw



More information about the R-help mailing list