R/multrnd_histc.R

multrnd_histc <- function(n,p)
{
    edges <- c(0, cumsum(p))
    l <- length(edges)
    r <- hist(runif(n)*edges[l], edges, plot = FALSE)$counts
    return(r)
}
siamakz/BNPseq documentation built on May 15, 2019, 4:28 p.m.