Description Usage Arguments Value Author(s) References See Also Examples
Generate random samples from a law added in the package as a C function.
1 |
law.index |
law index as given by function
|
n |
number of observations to generate. |
law.pars |
vector of parameters for the law. The length of this parameter should not exceed 4. |
check |
logical. If |
center |
Logical. Should we center the data generated |
scale |
Logical. Should we center the data generated |
A list containing the random sample and the vector of parameters used for the chosen law.
P. Lafaye de Micheaux, V. A. Tran
Pierre Lafaye de Micheaux, Viet Anh Tran (2016). PoweR: A Reproducible Research Tool to Ease Monte Carlo Power Simulation Studies for Goodness-of-fit Tests in R. Journal of Statistical Software, 69(3), 1–42. doi:10.18637/jss.v069.i03
See checklaw
1 2 3 4 5 6 7 8 9 10 11 12 | # This is good to check if the generator of the given law has been well coded.
res <- gensample(2,10000,law.pars=c(-5,2),check=TRUE)
res$law
res$law.pars
mean(res$sample)
sd(res$sample)
# See function checklaw() in this package.
hist(gensample(2,10000,law.pars=c(0,1),check=TRUE)$sample,prob=TRUE,breaks=100,main="Density
histogram of the N(0,1) distribution")
curve(dnorm(x),add=TRUE,col="blue")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.