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/PopGenome documentation built on Feb. 24, 2023, 7:11 a.m.