R/my_rdirichlet.R

my_rdirichlet <- function (n, alpha)
 
{
    l <- length(alpha)
    x <- matrix(rgamma(l * n, alpha), ncol = l, byrow = TRUE)
    sm <- x %*% rep(1, l)
    x/as.vector(sm)
}
pievos101/BlockFeST documentation built on March 16, 2021, 2:18 a.m.