Skip to content
Prev 14594 / 20628 Next

glmmADMB fails to fit poisson data

I would use

                   tmpl=-square(log(1.0+y(_i,1))-log(1.0+lambda));

for all cases in phase 1 of the minimization.  This provides  decent 
initial values for
the poisson_density.  However replacling

             tmpl =  log_density_poisson(y(_i,1),lambda);

with something like

     tmpl = log(e3+exp(log_density_poisson(y(_i,1),lambda)));

in some of the higher phase also serves another purpose.  Even when a 
lot of the
observations fit the model well there may be some outliers which can 
make the
arithmetic for calculating the mode of the random effects unstable for 
particular
values of the other model parameters picked by the optimization routine. 
The modification
tends to make the calculations more stable.  This was kind of a "quick 
fix"  when the code
was initially being developed. I'm sure it could be improved.