openCR: Confounding Likely

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

openCR: Confounding Likely

Postby ctlamb » Mon Dec 24, 2018 12:13 pm

I am running an OpenCR analysis, and have received this error from openCR.fit:

Code: Select all
In openCR.fit(capthist = grizzCH, mask = GBmask.o, type = "JSSAsecrlCL",  :
  variance calculation failed for some beta parameters; confounding likely


My call to openCR.fit is as follows, and it quite simple. I have two time periods for lambda (first and last 6 years of study), a Trap_Type covariate for lambda0, and null model for sigma:

Code: Select all
osecr.mult13trap.lambda <- openCR.fit(capthist = grizzCH, mask= GBmask.o, type = 'JSSAsecrlCL',
                                list(lambda~scov, lambda0~Trap_Type, sigma~1),
                                sessioncov=c(rep("Early",times=6),rep("Late", times=6)),
                                trace=TRUE, ncores=6)



I have more complex models that include sex and sigma covariates, but he confounding error appears even with this simple model.

The issue appears to stem from the Trap_Type covariate:

Code: Select all
Beta parameters (coefficients)
                           beta    SE.beta         lcl           ucl
lambda0             -2.45756720 0.04468611 -2.54515037 -2.3699840248
lambda0.Trap_TypeRT -0.76491628        NaN         NaN           NaN
phi                  1.65395287 0.07747854  1.50209773  1.8058080063
lambda              -0.03289611 0.01639370 -0.06502717 -0.0007650474
lambda.scovLate      0.03608632 0.02539102 -0.01367916  0.0858518018
sigma                8.98285871 0.00560486  8.97187339  8.9938440354


I can see that I have a decent amount of each Trap_Type (BS or RT) across sessions:

Code: Select all
lapply(grizzCH, function(x) summary(covariates(traps(x))))
$Southern_Rockies_2006
 Trap_Type
 BS:68   
 RT: 2   

$Southern_Rockies_2007
 Trap_Type
 BS:71   
 RT: 7   

$Southern_Rockies_2008
 Trap_Type
 BS:75   
 RT:19   

$Southern_Rockies_2009
 Trap_Type
 BS:54   
 RT:89   

$Southern_Rockies_2010
 Trap_Type
 BS: 20   
 RT:116   

$Southern_Rockies_2011
 Trap_Type
 BS:14   
 RT:98   

$Southern_Rockies_2012
 Trap_Type
 BS: 16   
 RT:117   

$Southern_Rockies_2013
 Trap_Type
 BS: 37   
 RT:155   

$Southern_Rockies_2014
 Trap_Type
 BS: 24   
 RT:150   

$Southern_Rockies_2015
 Trap_Type
 BS:  0   
 RT:174   

$Southern_Rockies_2016
 Trap_Type
 BS:  0   
 RT:176   

$Southern_Rockies_2017
 Trap_Type
 BS:  0   
 RT:182


Any thoughts on where the issue lies?
ctlamb
 
Posts: 56
Joined: Mon Nov 04, 2013 9:44 pm

Re: openCR: Confounding Likely

Postby murray.efford » Mon Dec 24, 2018 1:53 pm

I wouldn't call this an 'error' - just one of the joys of open population analysis. Nonidentifiability happens. More constructively - try another parameterisation of recruitment - f is often more robust than lambda, and you can always feed that model as starting values to a lambda model.
Merry Christmas
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: openCR: Confounding Likely

Postby ctlamb » Sat Dec 29, 2018 6:53 pm

Thanks, Murray. Merry Christmas to you too!

So I tried a number of different model types with an even simpler model structure:

lambda0~Trap_Type, sigma~1

The model types I tried were:
1) JSSAsecrfCL
2) JSSAsecrf
3) JSSAsecrl
4) JSSAsecrlCL
5) JSSAsecrbCL

1-4 produced the same confounding warning. 5 produced no warnings...but I don't think I can get an estimate for lambda from 5 can I?
ctlamb
 
Posts: 56
Joined: Mon Nov 04, 2013 9:44 pm

Re: openCR: Confounding Likely

Postby ctlamb » Sun Dec 30, 2018 6:15 pm

ah, but i see that starting the lambda model (4) with the initial paramters of the "b" model (5) produces a lambda model without confounding. Interesting. Will run some more complex models and see how it goes
ctlamb
 
Posts: 56
Joined: Mon Nov 04, 2013 9:44 pm

Re: openCR: Confounding Likely

Postby ctlamb » Thu Jan 03, 2019 2:52 pm

Yes this has got me through most of the models I will need to run. Thanks!

Oddly, using the starting values of the "b" model doe produce a confounding warning with model 1, but not with the slightly more complex/parameterized model 2. I thought confounding would be more likely as I added parameters, in this case, a parameter for phi.

Code: Select all
mod1 <- openCR.fit(capthist = grizzCH, mask= GBmask.o, type = 'JSSAsecrlCL',
                                list(lambda~scov, lambda0~Trap_Type*Sex , sigma~Sex),
                                sessioncov=c(rep("Early",times=6),rep("Late", times=6)),
                                trace=TRUE, ncores=6, start=osecr.trap.b)

mod2 <- openCR.fit(capthist = grizzCH, mask= GBmask.o, type = 'JSSAsecrlCL',
                                list(lambda~scov, phi~scov, lambda0~Trap_Type*Sex , sigma~Sex),
                                sessioncov=c(rep("Early",times=6),rep("Late", times=6)),
                                trace=TRUE,  ncores=6, start=osecr.trap.b)
Last edited by ctlamb on Thu Jan 03, 2019 4:32 pm, edited 1 time in total.
ctlamb
 
Posts: 56
Joined: Mon Nov 04, 2013 9:44 pm

Re: openCR: Confounding Likely

Postby murray.efford » Thu Jan 03, 2019 4:17 pm

Glad you made progress. These are the sort of issues I have no answer for - and hence no promise to support.
Murray
(back after a few days away)
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: openCR: Confounding Likely

Postby ctlamb » Thu Jan 03, 2019 4:37 pm

No problem, I got what I needed done anyways. Thanks for the workaround.
ctlamb
 
Posts: 56
Joined: Mon Nov 04, 2013 9:44 pm


Return to analysis help

Who is online

Users browsing this forum: No registered users and 14 guests