rpdirichlet | R Documentation |
Random samples from the prior/posterior (i.e., product-Dirichlet) of the unconstrained product-multinomial model (the encompassing model).
rpdirichlet(n, alpha, options, drop_fixed = TRUE)
n |
number of samples |
alpha |
Dirichlet parameters concatenated across independent conditions (e.g., a1,a2, b1,b2,b3) |
options |
the number of choice options per item type, e.g., |
drop_fixed |
whether the output matrix includes the last probability for each category (which is not a free parameter since probabilities must sum to one). |
# standard uniform Dirichlet rpdirichlet(5, c(1,1,1,1), 4) rpdirichlet(5, c(1,1,1,1), 4, drop_fixed = FALSE) # two ternary outcomes: (a1,a2,a3, b1,b2,b3) rpdirichlet(5, c(9,5,1, 3,6,6), c(3,3)) rpdirichlet(5, c(9,5,1, 3,6,6), c(3,3), drop_fixed = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.