test1 {mcsm} | R Documentation |
This function is a direct implementation of the transform principle for the chi-square distribution, with poor performances even though the output is correct.
test1(Nsim = 10^4, df = 6)
Nsim |
Number of simulations |
df |
Degrees of freedom |
This function replicates rchisq(Nsim,df)
and thus should not be used.
This function produces a numerical vector of size Nsim.
For efficient chi-square simulation, make sure to use
rchisq
Christian P. Robert and George Casella
From Chapter 2 of EnteR Monte Carlo Statistical Methods
test2,rchisq
mean(test1()) # produces [1] 6.02526