rAlias | R Documentation |
Efficient method for generating discrete random variates from any distribution with a finite number (N) of states. The method is described in detail in Section 10.1 of the given reference.
rAlias(n, P)
n |
numeric, constant number of variates to be simulated |
P |
numeric, probability mass function, assuming states from 1 through N |
numeric vector of containing n simulated values from the given discrete distribution
S. Ross (1990) A Course in Simulation, MacMillan.
x <- rAlias(n = 100, P = c(1:5)/15)
table(x)/100
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.