Description Usage Arguments Details Value Author(s) Examples
Generates random numbers from the desired categorical distribution with given probabilities. Utilizes discrete uniform distribution.
1 | accept.reject(prob, a, b, n)
|
prob |
a vector of probabilities |
a |
a numeric value which denotes the lower bound of the discrete uniform |
b |
a numeric value which denotes the upper bound of the discrete uniform |
n |
a numeric value for sample size |
b-a+1 should be equal to the number of levels of the desired variable.
returns a vector of simulated sample of size n.
Ozgur Asar
1 | accept.reject(prob=c(0.3,0.4,0.2,0.1),a=0,b=3,n=100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.