pcountOpen: Hessian is not invertible

202 views
Skip to first unread message

Megan

unread,
Nov 5, 2013, 5:46:57 PM11/5/13
to unma...@googlegroups.com
I'm using pcountOpen for analysis of annual fish counts at 10 sites on a river with up to 6 spatial replicates (usually 3) per site for 16 years.  When I add any one of ten seasonal stream flow variables as a yearly site covariate on gamma, I get the error "Hessian is not invertible. Try using fewer covariates or providing starting values." I've tried using starting values but it doesn't help.  I've tried the same model with two species: one rare with low p (0.07) and one common with higher p (0.36).

The covariates I'd like to include to test for an effect on gamma are actually yearly covariates (i.e., they are the same for all sites within each year).  They represent seasonal flow patterns for the period between each annual survey.  

When I created fake covariate data that varied across sites within each year, the same model ran without the error. 

I'm not clear why one shouldn't be able to include yearly covariates on gamma (or omega) with the Dail-Madsen model.  Am I doing something silly?

Jeffrey Royle

unread,
Nov 5, 2013, 5:54:47 PM11/5/13
to unma...@googlegroups.com
hi Megan,
 standardize your covariate and that might fix the problem.
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.

Megan

unread,
Nov 6, 2013, 8:11:22 AM11/6/13
to unma...@googlegroups.com
Thanks Andy,

I should have mentioned that my covariates are standardized.  Any other suggestions? 

Richard Chandler

unread,
Nov 6, 2013, 9:19:05 AM11/6/13
to Unmarked package
Can you show a summary of your unmarkedFrame object? 

summary(umf)


--
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.



--
Richard Chandler
Assistant Professor
Warnell School of Forestry and Natural Resources
University of Georgia

Megan

unread,
Nov 6, 2013, 9:35:11 AM11/6/13
to unma...@googlegroups.com
Thanks for your help!  Below is the umf for one of the more rare species.  I have missing data for two entire consecutive years where the missing y values are "NA" and the missing covariate data are the standardized mean of zero.  There are also many missing y values for reps greater than 4, as replication in most site-years was 4 or less.

unmarkedFrame Object

10 sites
Maximum number of observations per site: 96 
Mean number of observations per site: 38.6 
Number of primary survey periods: 16 
Number of secondary survey periods: 6 
Sites with at least one detection: 10 

Tabulation of y observations:
    0    1     2     3    4      5    6     7    8    9   10   11   12 <NA> 
 119   78   59   46   30   15   16    8    8    4    1    1    1   574 

Site-level covariates:
     width        
 Min.   :-1.1970  
 1st Qu.:-0.4723  
 Median :-0.1725  
 Mean   : 0.0002  
 3rd Qu.: 0.2200  
 Max.   : 1.9420  

Yearly-site-level covariates:
      temp                 Q              max.sum              max.spr           dev.sum            dev.spr          
 Min.   :-2.630000   Min.   :-1.4224   Min.   :-0.8410000   Min.   :-1.0570   Min.   :-0.74100   Min.   :-1.1680000  
 1st Qu.:-0.527500   1st Qu.:-0.7793   1st Qu.:-0.6015000   1st Qu.:-0.8585   1st Qu.:-0.57875   1st Qu.:-0.9192500  
 Median : 0.000000   Median : 0.0000   Median :-0.3450000   Median :-0.3580   Median :-0.29950   Median :-0.2020000  
 Mean   :-0.003063   Mean   :-0.0377   Mean   :-0.0000625   Mean   : 0.0000   Mean   : 0.00000   Mean   :-0.0000625  
 3rd Qu.: 0.715000   3rd Qu.: 0.4714   3rd Qu.: 0.1825000   3rd Qu.: 0.5170   3rd Qu.: 0.09725   3rd Qu.: 0.7620000  
 Max.   : 2.200000   Max.   : 2.8853   Max.   : 2.7900000   Max.   : 2.0680   Max.   : 2.97400   Max.   : 1.8760000  
   
 hfd.sum               hfd.spr                min.sum                 min.spr                    median.sum            median.spr     
 Min.   :-0.49900    Min.   :-0.73700    Min.   :-0.975000    Min.   :-1.2940000     Min.   :-1.0750000    Min.   :-1.1970  
 1st Qu.:-0.49900   1st Qu.:-0.57100   1st Qu.:-0.680000   1st Qu.:-0.5502500   1st Qu.:-0.7557500   1st Qu.:-0.6767  
 Median :-0.49900   Median :-0.32200   Median :-0.460000   Median :-0.4005000   Median :-0.3115000   Median :-0.3935  
 Mean   : 0.00025   Mean   :-0.00025   Mean   :-0.000125   Mean   :-0.0000625   Mean   :-0.0000625   Mean   : 0.0000  
 3rd Qu.:-0.16625   3rd Qu.: 0.09300   3rd Qu.: 0.425500   3rd Qu.: 0.7157500   3rd Qu.: 0.5752500   3rd Qu.: 0.6577  
 Max.   : 2.76900   Max.   : 2.75000   Max.   : 2.193000   Max.   : 2.2460000   Max.   : 2.4540000   Max.   : 2.4860  


On Tuesday, November 5, 2013 5:46:57 PM UTC-5, Megan wrote:

Richard Chandler

unread,
Nov 6, 2013, 9:58:34 AM11/6/13
to Unmarked package
Okay, can you also show the results you get when you set the "se" argument to FALSE?

pcountOpen(...., se=FALSE)




--
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.

Megan

unread,
Nov 6, 2013, 10:09:47 AM11/6/13
to unma...@googlegroups.com
Here are the results from there models: null model with and without se=F, and a model with an effect on gamma with se=F (same as if se=T).

1. Call: pcountOpen(lambdaformula = ~1, gammaformula = ~1, omegaformula = ~1,  pformula = ~1, mixture = "P", K = 100, dynamics = "trend")

Abundance:
 Estimate    SE    z  P(>|z|)
     3.66 0.266 13.8 3.73e-43

Recruitment:
 Estimate     SE     z  P(>|z|)
  -0.0911 0.0199 -4.57 4.96e-06

Detection:
 Estimate    SE     z  P(>|z|)
    -2.35 0.263 -8.93 4.11e-19

AIC: 1463.854 

2. Call: pcountOpen(lambdaformula = ~1, gammaformula = ~1, omegaformula = ~1,  pformula = ~1,  mixture = "P", K = 100,  dynamics = "trend", se = F)

Abundance:
 Estimate SE  z P(>|z|)
     3.66 NA NA      NA

Recruitment:
 Estimate SE  z P(>|z|)
  -0.0911 NA NA      NA

Detection:
 Estimate SE  z P(>|z|)
    -2.35 NA NA      NA

AIC: 1463.854 

3. Call: pcountOpen(lambdaformula = ~1, gammaformula = ~max.sum, omegaformula = ~1,  pformula = ~1, mixture = "P", K = 100, dynamics = "trend", starts = c(1, 0.01, 0.01, 0.2), se = FALSE)

Abundance:
 Estimate SE  z P(>|z|)
        1 NA NA      NA

Recruitment:
            Estimate SE  z P(>|z|)
(Intercept)     0.01 NA NA      NA
max.sum         0.01 NA NA      NA

Detection:
 Estimate SE  z P(>|z|)
      0.2 NA NA      NA

AIC: 14175.93 




On Tuesday, November 5, 2013 5:46:57 PM UTC-5, Megan wrote:

Richard Chandler

unread,
Nov 6, 2013, 12:46:38 PM11/6/13
to Unmarked package
Hi Megan,

You should try using starting values that are based on the estimates from the simpler model. I wonder if this will work:

pcountOpen(lambdaformula = ~1, gammaformula = ~max.sum, omegaformula = ~1,  pformula = ~1, mixture = "P", K = 100, dynamics = "trend", starts = c(3.66, -0.091, 0, -2.35), se = TRUE)

I wouldn't get your hopes too high, however, because you have a fairly small data set, and your estimate of detection probability is very low.

Richard




--
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.

Megan

unread,
Nov 6, 2013, 3:07:25 PM11/6/13
to unma...@googlegroups.com
Unfortunately, better starting values didn't matter for either a rare (p=0.07) or common (p=0.36) species.  I'm still hung up that the model will run with a true yearly-site covariate on gamma (instead of a yearly covariate that repeats across sites), but I understand the problem could be due to small sample size.  I am resigned to trying analysis in JAGS or BUGs. 
Thanks for your time,


On Tuesday, November 5, 2013 5:46:57 PM UTC-5, Megan wrote:
Reply all
Reply to author
Forward
0 new messages