rchi2 {lazy.stat}R Documentation

Chi Squared Random Numbers

Description

Chi Squared Random Numbers

Usage

rchi2(n, nu, kappa2)

Arguments

n

# of random numbers to be generated

nu

The degrees of freedom

kappa2

The scale parameter

Details

kappa2 * chi squared with df=nu is chi squared with nu and kappa2.
If X is distributed as chi2( nu ),
Y2 = kappa2 * X is chiq( nu, kappa2 ).
Equivalently,
Y2 / kappa2 is distributed as chi2( nu ).

E( Y2 ) = nu*kappa2
var( Y2 ) = 2*nu*kappa2^2
mode( Y2 ) = kappa2*(nu-2)

Value

vector of length n

Examples

set.seed(1701)
x <- rchi2( 10000, 10, 1 )
Print( mean(x), var(x), sqrt(var(x)) )


[Package lazy.stat version 0.1.4 Index]