[R] hurdle control and optim

Matt Dicken matt at shark.co.za
Mon Aug 17 11:16:43 CEST 2015


I was hoping someone may be able to help with the following.

I fit the model below using the pscl package. I am modelling catch data (about 17,000 entry points) so lots of zero's

fit.hurdle.bin = hurdle(Catch ~ Beach + Region + Year+
                      Decade + Month + Season + Whale+ Sex + Size+ meantemp +
                      meanviz + offset(log(Length.nets..km.)),
                      dist="poisson",zero.dist="binomial",link="logit",trace=T)

The model output tells me that:
Warning message: In sqrt(diag(object$vcov)) : NaNs produced (against year)

I then use hurdle control with "L-BFGS-B" to set some parameter controls to solve this issue, but get the warning message:
L-BFGS-B needs finite values of 'fn'
In addition: Warning message:
In optim(fn = countDist, gr = countGrad, par = c(start$count, if (dist ==  :
  method L-BFGS-B uses 'factr' (and 'pgtol') instead of 'reltol' and 'abstol'

How do I write the script for Hurdle control to solve these issues?
Any help would be really appreciated
All the best
Matt





Dr. Matt Dicken
Senior Scientist
Telephone: 0315660400 | Fax: 0315660493 | Email: matt at shark.co.za
Physical Address: 1a Herrwood Drive, Umhlanga Rocks, 4320 | www.shark.co.za

[http://www.shark.co.za/ImageHandler.ashx?fguid=2c107195-209c-4fb2-aae5-31e45ce5de1a]

Connect with us on social media: [KZNSB Facebook]  <https://www.facebook.com/kznsb> [KZNSB Twitter]  <https://twitter.com/KznSharks?lang=en>

	[[alternative HTML version deleted]]



More information about the R-help mailing list