Zero-inflated negative binomial
// from Ben Bolker
rzinbinom <- function(n, mu, size, zprob) { ifelse(runif(n) < zprob, 0, rnbinom(n, mu=mu, size=size)) }
DZone Snippets > mroutley > distribution
12387 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Matthew Routley http://matt.routleynet.org
rzinbinom <- function(n, mu, size, zprob) { ifelse(runif(n) < zprob, 0, rnbinom(n, mu=mu, size=size)) }