R/rgendiri.R

Defines functions rgendiri

Documented in rgendiri

rgendiri <- function(n, a, b) {
  ##  n is the sample size
  ##  a is the parameters vector
  D <- length(a)
  y <- rangen::colRgamma(n, D, shape = a, rate = b)
  y / Rfast::rowsums(y)  ## Dirichlet simulated values
}

Try the Compositional package in your browser

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

Compositional documentation built on Sept. 15, 2026, 9:07 a.m.