In sqrt(diag(vcov(model))) : NaNs produced

6,039 views
Skip to first unread message

Evan Hill

unread,
Jan 15, 2014, 12:33:08 PM1/15/14
to unma...@googlegroups.com
Hello unmarked group,

I posted a similar question about having received the 'NaNs produced' error, but because this is a slightly different situation I thought I'd post a new thread.  
I am using unmarked to calculate occupancy as a function of several habitat covariates.  In the following situation, I have five habitat covariates and I'm attempting a dredge.  
I did not get this error for all of my species, which is why it is so confusing to me.  I am using the same habitat data for each species' detection history, which is why I was confused as to why I didn't get the error with each species.  Thank you in advance.
Here is the context:

Global2<-occu(~Day+Wind+Time+Obs~Ow+Pev+Npev+Agric+Shrub,MOSpring2013)
MuMIn:::fixCoefNames(names(coef(Global2)))
ms2<-dredge(Global2,beta=F,evaluate=T,rank="AICc",fixed=~p(Day)+p(Wind)+p(Time))
In sqrt(diag(vcov(model))) : NaNs produced
ms2.topmodels4<-subset(ms2,delta<=4)
ms2.topmodels4
ms2.avg<-model.avg(ms2.topmodels4)
ms2.avg
summary(ms2.avg)

Best regards,

Evan Hill

Jeffrey Royle

unread,
Jan 15, 2014, 4:41:24 PM1/15/14
to unma...@googlegroups.com
hi Evan,
 I think this is a basic identifiability problem. Sparse data , small data sets, could cause it (e.g., either all sites occupied or not occupied or the right mix with respect to the covariates).  I suggest looking at the species for which it happens and building the model up from a smaller model to a bigger model and finding where the breakdown happens.
regards
andy


--
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

alex....@gmail.com

unread,
Jan 15, 2016, 12:03:34 PM1/15/16
to unmarked
Hi Andy et al.,

I've been running sets of models in colext and often one or two models will come up with the "In sqrt(diag(vcov(model))) : NaNs produced" warning.  However, there are estimates for all of the parameters in the models with warnings, unmarked has just failed to estimate the SE for a parameter or two.  In the below modSel output, only the psi(Taxon), col(Taxon+year), ext(Taxon+year), p(Taxon+season+Taxon:season) had a warning, and that model had a delta AIC of ~47.  Output for that model is below.  Note that more complex models with the same covariates are successfully fit with parameter estimates, although they're ranked lower in this case.  

My question is: are AIC scores accurate for such a model where one or two parameters' SE can't be estimated?  Practically speaking, can I be satisfied that the top ranked model, or competitive models (delta AIC <2 or even , say, <8 or 10 delta AIC) are reflecting the important covariates, despite the NaNs produced?  Or does the failure to estimate SE for one parameter in a model somehow grossly affect that model's AIC score?

Thanks,
Alex Wolf

Model List
(ms <- modSel(fms))
nPars AIC delta AICwt cumltvWt
psi(Taxon), col(Taxon), ext(Taxon), p(Taxon+season+Taxon:season) 24 1768.04 0 1.00E+00 1
psi(Taxon), col(year), ext(year), p(Taxon+season+Taxon:season) 20 1791.7 23.66 7.30E-06 1
psi(Taxon), col(Taxon+year), ext(Taxon+year), p(Taxon+season+Taxon:season) 26 1814.95 46.91 6.50E-11 1
psi(Taxon), col(Taxon+year+Taxon:year), ext(Taxon+year+Taxon:year), p(Taxon+season+Taxon:season) 32 1826.45 58.41 2.10E-13 1
psi(.), col(.), ext(.), p(.) 4 1877.28 109.24 1.90E-24 1
psi(Taxon), col(year+I(year^2)), ext(year+I(year^2)), p(Taxon+season+Taxon:season) 22 1969.17 201.12 2.10E-44 1
psi(Taxon), col(Taxon+year+I(year^2)), ext(Taxonyear+I(year^2)), p(Taxon+season+Taxon:season) 28 1976.46 208.42 5.50E-46 1
psi(Taxon), col(Taxon+year+Taxon:year+I(year^2)), ext(Taxon+year+Taxon:year+I(year^2)), p(Taxon+season+Taxon:season) 34 1999.38 231.34 5.80E-51 1

MODEL OUTPUT:

colext(psiformula = ~Taxon, gammaformula = ~Taxon + year, epsilonformula = ~Taxon +

    year, pformula = ~Taxon + Season + Taxon:Season, data = comm.umf)

 

Initial:

                Estimate      SE      z P(>|z|)

(Intercept)        0.339   0.649 0.5227   0.601

TaxonLizard        1.270   1.273 0.9974   0.319

TaxonSalamander   18.785 208.111 0.0903   0.928

TaxonSnake         0.677   0.849 0.7976   0.425

 

Colonization:

                Estimate     SE      z  P(>|z|)

(Intercept)       -2.295 0.5807 -3.952 7.74e-05

TaxonLizard       -1.072 1.0995 -0.975 3.30e-01

TaxonSalamander    1.112 0.6576  1.691 9.09e-02

TaxonSnake        -1.075 0.7245 -1.483 1.38e-01

year               0.071 0.0357  1.991 4.65e-02

 

Extinction:

                Estimate       SE       z  P(>|z|)

(Intercept)      -1.8167   0.5215 -3.4835 0.000495

TaxonLizard     -15.3575 209.8791 -0.0732 0.941669

TaxonSalamander  -0.8803   0.5831 -1.5096 0.131140

TaxonSnake      -17.5820      NaN     NaN      NaN

year              0.0073   0.0369  0.1976 0.843371

 

Detection:

                               Estimate    SE      z  P(>|z|)

(Intercept)                      -0.199 0.226 -0.879 3.79e-01

TaxonLizard                       1.791 0.389  4.602 4.18e-06

TaxonSalamander                   1.254 0.327  3.838 1.24e-04

TaxonSnake                       -0.217 0.267 -0.811 4.17e-01

SeasonFall                        1.323 0.343  3.853 1.16e-04

SeasonL_Spring                    0.744 0.319  2.330 1.98e-02

TaxonLizard:SeasonFall           -1.909 0.539 -3.545 3.93e-04

TaxonSalamander:SeasonFall       -0.327 0.526 -0.622 5.34e-01

TaxonSnake:SeasonFall            -0.891 0.397 -2.244 2.48e-02

TaxonLizard:SeasonL_Spring       -0.841 0.544 -1.545 1.22e-01

TaxonSalamander:SeasonL_Spring   -1.274 0.447 -2.848 4.41e-03

TaxonSnake:SeasonL_Spring        -0.545 0.377 -1.447 1.48e-01

daniel.p...@gmail.com

unread,
May 10, 2017, 3:18:56 PM5/10/17
to unmarked
Bump.

Jessica Gouvea

unread,
Mar 2, 2021, 3:02:52 PM3/2/21
to unmarked
Hi group,

I had the same problem, but I already received the message (In sqrt (diag (vcov (model))): NaNs produced) for the null model. What could be happening?
The naive occupancy is about 0.8 and I have 58 sites.

Thanks in advance,
Regards
Jessica.

Reply all
Reply to author
Forward
0 new messages