GenData {SALTSampler} | R Documentation |
Synthetic Data From a Multinomial Distribution
Description
This function generates a synthetic data set representing multiple draws from a multinomial distribution with user-specified parameters. A matrix of n
rows corresponding to each draw is outputted where the entry in the ith column and the jth row gives the number of the items that were in the ith bin on the jth trial.
Usage
GenData(center, n, size)
Arguments
center |
Vector of numeric values defining the parameters of a multinomial distribution. The ith value corresponds to the likelihood of a random variable being drawn from the ith bin |
n |
The |
size |
The |
References
R Core Team (2015). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/.
rmultinom
: https://stat.ethz.ch/R-manual/R-patched/library/stats/html/Multinom.html
Examples
#Generate sample data from a multinomial distribution
GenData(center = c(0.2, 0.3, 0.5), n = 10, size = 20)