On Fri, 30 Jun 2006, Long Qu wrote:
> Hi there:
>
> I'd thought these two versions of noncentral t-distribution are essentially
> the same:
> > qqplot(rt(1000,df=20,ncp=3),qt(runif(1000),df=20,ncp=3))
>
> But, the scales of the x-axis and the y-axis are quite different according
> to the QQ-plot.
>
> Did I make any mistakes somewhere?
>
No, I think we did.
We have
> rt
function (n, df, ncp = 0)
{
if (ncp == 0)
.Internal(rt(n, df))
else rnorm(n, ncp)/(rchisq(n, df)/sqrt(df))
}
and the rchisq() in the denominator should be inside the sqrt().
-thomas
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html