Description Usage Arguments Value Author(s) References Examples
samples from a k-multinomial.
1 | multinomial(weights, k)
|
weights |
numeric vector with the weights of the multinomial. Sum to 1. |
k |
size of the weight vector. |
an integer value in [1,k], coded as a 1-of-k variable (see reference).
Pierrick Bruneau
Bishop, C. M. (2006) _Pattern Recognition and Machine Learning_ Chap. 10, Springer.
1 2 3 | weights <- c(0.3, 0.5, 0.2)
multinomial(weights, 3)
#[1] 0 1 0
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.