R/test1.R

Defines functions test1 test2

Documented in test1 test2

test1=function(Nsim=10^4,df=6){
# simple derivation of a chi-square sample

midf=df/2
U=matrix(data=runif(midf*Nsim),nrow=midf)
2* apply(-log(U),2,sum)
}

test2=function(Nsim=10^4,df=6){
# simple derivation of a chi-square sample

rchisq(Nsim,df)
}

Try the mcsm package in your browser

Any scripts or data that you put into this service are public.

mcsm documentation built on May 2, 2019, 10:16 a.m.