[R] zeroinfl() or zicounts() error

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Thu Jul 26 21:02:55 CEST 2007


On Thu, 26 Jul 2007, Rachel Davidson wrote:

> I'm trying to fit a zero-inflated poisson model using zeroinfl() from the
> pscl library. It works fine for most models I try, but when I include either
> of 2 covariates, I get an error.
>
> When I include "PopulationDensity", I get this error: Error in solve.default
> (as.matrix(fit$hessian)) :        system is computationally singular:
> reciprocal condition number = 1.91306e-34
>
> When I include "BuildingArea", I get this error: Error in optim(fn =
> loglikfun, par = c(start$count, start$zero, if (dist ==  :
> non-finite finite-difference value [2]

Might be due to some close to linear dependencies in your regressor
matrix...

>  I tried fitting the models using zicounts in the zicounts library as well
> and had the same difficulty.

If I recall correctly, zicounts() usses a very similar type of
optimization compared to zeroinfl(), hence the similar problems.

>  When I include "PopulationDensity", it runs, but outputs only the parameter
> estimates, not the standard errors or p-values (those have NaN).

This is due to the same problem as above for zeroinfl(), the Hessian
matrix is (close to) singular.

> When I include "BuildingArea", I get this error: Error in
> solve.default(z0$hessian)
> : system is computationally singular: reciprocal condition number =
> 2.58349e-25
>
> Can anyone suggest what it is about these 2 covariates that might be causing
> the problem? I don't see any obvious problems with them. They are both
> nonnegative with smooth probability distributions and no missing ("NA")
> values. The dataset has 3211 observations. It doesn't matter if there are
> other covariates in the models or not. If one of these is included, I get
> the errors.

Even if you include just one covariate and nothing else?
  zeroinfl(y ~ PopulationDensity, data = ...)

Z



More information about the R-help mailing list