Message Boards Message Boards

How do I model a zero-inflated continous distribution?

Hi,

I would like to model a zero-inflated continous distribution, but the built-in functions do not allow mixing discrete and continous distributions. I have made some ad hoc attempts but they are not very pretty. Any suggestions?

Thanks, Christian

Posted 9 years ago

Why don't you build your own distribution? Using a simple -if- you can inflate it in zero, and deflate it elsewhere accordingly, in order to achieve what you want.

For instance, suppose that you want to create a zero inflated poisson:

inflation=0.99; (* random value for inflation *)
l=1.1; (* random value for expectancy *)
g[x_]:=PDF[PoissonDistribution[l],x];

gZI[x_]:=If[
x==0,(1-inflation)+inflation*g[0],
inflation*g[x]
];

In[6492]:= g[0]
gZI[0]

Out[6492]= 0.332871

Out[6493]= 0.339542

Sum[g[i], {i, 0, 100}]
Sum[gZI[i], {i, 0, 100}]

Out[6495]= 1.

Out[6496]= 1.

I gues you can create the same way continuous zero inflated distributions.

POSTED BY: Tom Zinger
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract