Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1.49 KB

README.md

File metadata and controls

29 lines (21 loc) · 1.49 KB

ZeroInflation.jl

Stable Dev Build Status Coverage

This package provides simple utilities for constructing zero-inflated distributions. It is mainly intended to for fitting zero-inflated and hurdle models using Turing.jl.

Basic usage

ZeroInflation.jl exports a single function (zeroinflated) that can be used to construct arbitrary zero-inflated distributions. For example to construct a zero-inflated Poisson distribution with parameter λ = 1.0 and mixing probability θ = 0.2, call

zeroinflated(Poisson(1.0), 0.2)

Sometimes it can be useful (e.g. in regression modelling) to express the mixing distribution not in terms of raw probabilities, but on the logit scale. In this case the distribution with parameter λ = 1.0 and mixing probability θ = logistic(0.0) can be constructed by

zeroinflated(Poisson(1.0), StatsFuns.logistic(0.0))

or by directly providing a logit parameterized Bernoulli distribution,

zeroinflated(Poisson(1.0), Turing.BernoulliLogit(0.0))

.