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)
}

Try the BlockFeST package in your browser

Any scripts or data that you put into this service are public.

BlockFeST documentation built on March 15, 2021, 9:07 a.m.