rpgm.rt: Fast Simulation of Student Random Variables

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/rpgm.rt.R

Description

The function rpgm.rt uses rpgm.rnorm in order to simulate student random variables faster than rt.

Usage

1
rpgm.rt(n, df)

Arguments

n

integer, number of simulations.

df

double, degrees of freedom (> 0, maybe non-integer).

Details

If df = 1, the distribition if the Cauchy one. The mean exists when df > 1 and the variance when df > 2.

Value

A vector of i.i.d. student random variables.

Note

For a big number of simulations, it is approximately 1.5 times faster than the usual rt.

Author(s)

Nicolas Baradel - PGM Solutions

References

https://en.wikipedia.org/wiki/Ziggurat_algorithm

See Also

http://pgm-solutions.com/packages

Examples

1
rpgm.rt(5, 4)

rpgm documentation built on March 18, 2018, 2:24 p.m.