[R] zeroinfl() or zicounts() error

2007-07-26 Thread Rachel Davidson
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]

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

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

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.

Thanks!

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] zeroinfl() or zicounts() error

2007-07-26 Thread Achim Zeileis
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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.