bnp

Some older Bayesian nonparametrics research.
git clone git://git.jtobin.io/bnp.git
Log | Files | Refs | README | LICENSE

fmm_utils.r (141B)


      1 rdirichlet = function(n, a) {
      2   l = length(a)
      3   x = matrix(rgamma(n * l, a), ncol = l, byrow = T)
      4   s = x %*% rep(1, l)
      5   x / as.vector(s)
      6 }