Description Usage Arguments Value See Also Examples
View source: R/Categorical_Inference.r
Generate random integer samples from a Categorical distribution. For a random variable x, the density function of categorical distribution is defined as
prod_{k in 1:K} p_k^{I(x=k)}
Where K is the number of unique values.
1 | rCategorical(n, p)
|
n |
integer, number of samples. |
p |
numeric, probabilities. length(p)=K. |
An integer vector of length n.
1 | rCategorical(n=20,p=c(1,2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.