[R] transform normally distributed random terms to gamma distributed random terms

From: Stefan Pohl <pohl_at_marge.statistik.uni-koeln.de>
Date: Tue 24 May 2005 - 04:46:01 EST


I have normally distributed random terms u~N(0,1). I want to get gamma distributed random terms g~(scale,shape) with E(g)=1=shape/scale and var(g)=theta=1/scale=1/shape.

How can I reach my goal? The following way doesn't work: use the distribution function of u to get U(0,1)- distributed random terms, then take the quantile function of the gamma distribution with shape and scale.

The resulting random terms must be ~gamma(shape, scale).

But it doesn't work.

Is there a mistake or do you know another way?

Thanks, Stefan.

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 24 04:55:55 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:00 EST