Description Usage Arguments Details Value Examples
(dn) As far as I understood, there is no possibility to use the
standard rmultinom in a parallel way to get the complete set of
simulations with a unique call. This is why this function was
created, if necessary it could be replaced by some C code one day.
There is two ways to use the function. (i) When is.null(levels) as a
multivariate multinomials with different sizes, (ii) When levels is a
non null character, then a categorical taking the levels values is
returned.
1 | draw8multinom(n, size, proba, levels=NULL)
|
n |
Number of draws to obtain. |
size |
Vector [n] of the sizes of the multinomials. |
proba |
Matrix [n,k] of the probabilities of the multinomials. |
levels |
When a categoric variable must be returned, levels provides its levels (since it is a factor). |
When !is.null(levels) size is forced to be a vector of ones.
when is.null(levels) the integer matrix [n,k] of the draws is returned else a factor.
1 2 3 | rebastaba3k("RESET"); # for the sake of R checking
draw8multinom(10, 1:10, matrix(1:10, 10, 3, byrow=TRUE));
draw8multinom(10, rep(1, 10), matrix(1:10, 10, 3, byrow=TRUE), levels=LETTERS[1:3]);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.