<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Is there a way to specify a zero-inflated poisson distribution (error structure) to a generalized linear model in the Fit Model platform? I see I can specify normal, binomial, poisson, and exponential distributions; but what I need is a zero-inflated poisson distribution... Any help greatly appreciated. Thanks.
Clay Barker has a nice ZIPoisson example on the JMP File exchange..
// set up the ZIP negative log likelihood with the starting values defined above
Exform = expr(
ll << set formula(Parameter(
{p = expr(pstart), lambda = expr(lstart)},
If( :Y == 0,
-Log( p + (1 - p) * Exp( -lambda ) ),
-Log(
(1 - p) * ((Exp( -lambda ) * lambda ^ :Y) /
Factorial( :Y ))
)
)
)));
// now plug the starting values into the negative log likelihood column
eval(eval Expr(exform));
// use nonlinear to minimize the negative log likelihood, which is equivalent to maximizing the likelihood
nl = Nonlinear(
Loss( :NegLogLik ),
Loss is Neg LogLikelihood( 1 ),
Newton,
Finish
);
I don't know of a way to fit a ZI model of any type automatically. I have always fit two part models, one part to model 0 or not 0 and a second to model the not 0 portion, then combined the models.