rpdirichlet {multinomineq} | R Documentation |
Random Samples from the Product-Dirichlet Distribution
Description
Random samples from the prior/posterior (i.e., product-Dirichlet) of the unconstrained product-multinomial model (the encompassing model).
Usage
rpdirichlet(n, alpha, options, drop_fixed = TRUE)
Arguments
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). |
Examples
# 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)
[Package multinomineq version 0.2.6 Index]