test1 {mcsm}R Documentation

Poor chi-square generator

Description

This function is a direct implementation of the transform principle for the chi-square distribution, with poor performances even though the output is correct.

Usage

test1(Nsim = 10^4, df = 6)

Arguments

Nsim Number of simulations
df Degrees of freedom

Details

This function replicates rchisq(Nsim,df) and thus should not be used.

Value

This function produces a numerical vector of size Nsim.

warning

For efficient chi-square simulation, make sure to use rchisq

Author(s)

Christian P. Robert and George Casella

References

From Chapter 2 of EnteR Monte Carlo Statistical Methods

See Also

test2,rchisq

Examples

mean(test1())
# produces [1] 6.02526

[Package mcsm version 1.0 Index]