draw.t {UnivRNG} | R Documentation |
This function implements pseudo-random number generation for a standard-t
distribution with pdf
f(x|\nu)=\frac{\Gamma(\frac{\nu+1}{2})}{\Gamma(\frac{\nu}{2})\sqrt{\nu\pi}}(1+\frac{x^2}{\nu})^{-(\nu+1)/2}
for -\infty < x < \infty
where \nu
is the degrees of freedom.
draw.t(nrep,dof)
nrep |
Number of data points to generate. |
dof |
Degrees of freedom of the desired t distribution. |
A list of length five containing generated data, the theoretical mean, the empirical mean, the theoretical variance, and the empirical variance with names y, theo.mean, emp.mean, theo.var, and emp.var, respectively.
Bailey, R. W. (1994). Polar generation of random variates with the t-distribution. Mathematics of Computation, 62, 779-781.
draw.t(nrep=100000,dof=2)
draw.t(nrep=100000,dof=6)