simulates random draws for a numcat distribution
(dn) This function simulates a categoric distribution. Similar to the
multinomial distribution but the size parameter is one and it is
considered as a univariate distribution. Values are the numbers of
lev] categories. If necessary this function could be
replaced by some C code... Possible conditional distribution are
introduced if !is.null(parents) using their order and unex
convention. See the description provided in the function
already generated parents. If no one, must be a matrix nx0 to indicate the number of draws to perform.
Matrix [p,k] of the probabilities of the multinomials.
When there are no parents, p=1 because the distribution is the same
for all the draws. When there are parents, it is the product of the
numbers of categories of the parents. By the way, the parents must be
When null a distribution is drawn with values from
When null no parents. If not, the parent names as variables names if any. Be careful that their order is significant for the interpretation of the proba matrix.
Only when there are parents. Then The vector of lengths of levels of the parents. This cannot be deduced from the simulated values because some of the levels can be missing.
a vector [n] of the draws is returned (it is a factor).
1 2 3 4 5 6 7 8 9
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.