Simulation of compositional data from mixtures of Dirichlet distributions | R Documentation |
Simulation of compositional data from mixtures of Dirichlet distributions.
rmixdiri(n, a, prob)
n |
The sample size. |
a |
A matrix where each row contains the parameters of each Dirichlet component. |
prob |
A vector with the mixing probabilities. |
A sample from a Dirichlet mixture model is generated.
A list including:
id |
A numeric variable indicating the cluster of simulated vector. |
x |
A matrix containing the simulated compositional data. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
Ye X., Yu Y. K. and Altschul S. F. (2011). On the inference of Dirichlet mixture priors for protein sequence comparison. Journal of Computational Biology, 18(8), 941-954.
rmixcomp, mixdiri.contour,
a <- matrix( c(12, 30, 45, 32, 50, 16), byrow = TRUE,ncol = 3)
prob <- c(0.5, 0.5)
x <- rmixdiri(100, a, prob)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.