rdiric(n, shape, dimension = NULL, is.matrix.shape = FALSE)
is.matrix.shape
below.dimension
is specifed, values
are recycled if necessary to length dimension
.dimension
is not numeric then it is taken to be
length(shape)
(or ncol(shape)
if is.matrix.shape == TRUE
).TRUE
then shape
must be a matrix, and then
n
is no longer the number of rows of the answer but the
answer has n * nrow(shape)
rows.
If FALSE
(the default) then shap
n
by dimension
matrix of Dirichlet random variates.
Each element is positive, and each row will sum to unity.
If shape
has names then these will become the column names
of the answer.dirichlet
is a ddata <- data.frame(rdiric(n = 1000, shape = c(y1 = 3, y2 = 1, y3 = 4)))
fit <- vglm(cbind(y1, y2, y3) ~ 1, dirichlet, data = ddata, trace = TRUE)
Coef(fit)
coef(fit, matrix = TRUE)
Run the code above in your browser using DataLab