rAlias: Alias Method for Generating Discrete Random Variates
Description
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.
Usage
rAlias(n, P)
Value
numeric vector of containing n simulated values from the given discrete distribution
Arguments
n
numeric, constant number of variates to be simulated
P
numeric, probability mass function, assuming states from 1 through N