JSSAsecrD - openCR 2.2.1

78 views
Skip to first unread message

Gabrielle Beca

unread,
Nov 23, 2021, 3:05:25 AM11/23/21
to secr
Hi everyone,

I'm using openCR (2.2.1)  to estimate D of Northern quolls from 9 sections with variable trap usage. I'm trying to use JSSAsecrD models but they keep failing. That's my code:

quoll_f <- read.capthist(captfile = "quolls_capturedata_f.txt",
   trapfile = list ("2011_traplocs.txt",
                    "2014_traplocs.txt", 
                    "2015_traplocs.txt", 
                    "2016_traplocs.txt", 
                    "2017_traplocs.txt",
                    "2018_traplocs.txt",
                    "2019_traplocs.txt",
                    "2020_traplocs.txt",
                    "2021_traplocs.txt"),
   detector = "multi",
   fmt = c("trapID","XY"),
   verify = TRUE)

intervals(quoll_f)<-c(36,12,12,12,12,12,12,12)/12
summary(quoll_f)

RPSV(quoll_f,CC = TRUE)

$`1`
[1] 85.41759

$`2`
[1] 83.40466

$`3`
[1] 74.4249

$`4`
[1] 110.6227

$`5`
[1] 77.7946

$`6`
[1] NaN

$`7`
[1] 59.57558

$`8`
[1] 54.9295

$`9`
[1] 64.75724

mask_quoll_f <- make.mask (traps(quoll_f), buffer = 450, type = 'trapbuffer')

quoll_model_f <- openCR.fit(quoll_f, type = 'JSSAsecrD',mask=mask_quoll_f,
                  model=list(sigma~t,lambda0~t,phi~t, D~t))

N animals       :  19  
N detections    :  51 
N sessions      :  9 (secondary 54)
Intervals       :  0 0 0 0 0 0 3 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 

Analysis type   :  JSSAsecrD 
Model           :  lambda0~t phi~t D~t sigma~t 
Fixed (real)    :  none 
Movement model  :  static 
N parameters    :  35 
Log likelihood  :  4e+10 
AIC             :  -8e+10 
AICc            :  NA 

Parameter Link 
lambda0   log 
phi       logit 
D         log 
sigma     log 

Beta parameters (coefficients) 
                   beta SE.beta          lcl          ucl
lambda0    -6.203135373       0 -6.203135373 -6.203135373
lambda0.t2 -0.303866978       0 -0.303866978 -0.303866978
lambda0.t3 -0.579951665       0 -0.579951665 -0.579951665
lambda0.t4 -0.306556062       0 -0.306556062 -0.306556062
lambda0.t5 -0.059169945       0 -0.059169945 -0.059169945
lambda0.t6 -0.082609665       0 -0.082609665 -0.082609665
lambda0.t7 -0.033335454       0 -0.033335454 -0.033335454
lambda0.t8 -0.051821369       0 -0.051821369 -0.051821369
lambda0.t9 -0.064279590       0 -0.064279590 -0.064279590
phi         1.558678518       0  1.558678518  1.558678518
phi.t2      0.065484080       0  0.065484080  0.065484080
phi.t3      0.078539555       0  0.078539555  0.078539555
phi.t4      0.061121671       0  0.061121671  0.061121671
phi.t5      0.089309085       0  0.089309085  0.089309085
phi.t6      0.099340242       0  0.099340242  0.099340242
phi.t7      0.096221697       0  0.096221697  0.096221697
phi.t8      0.108237779       0  0.108237779  0.108237779
D          -4.124766944       0 -4.124766944 -4.124766944
D.t2       -0.166545820       0 -0.166545820 -0.166545820
D.t3        0.001148656       0  0.001148656  0.001148656
D.t4       -0.165479142       0 -0.165479142 -0.165479142
D.t5       -0.169054891       0 -0.169054891 -0.169054891
D.t6       -0.171239887       0 -0.171239887 -0.171239887
D.t7       -0.150845091       0 -0.150845091 -0.150845091
D.t8       -0.158959095       0 -0.158959095 -0.158959095
D.t9       -0.497977849       0 -0.497977849 -0.497977849
sigma      15.586927067       0 15.586927067 15.586927067
sigma.t2    0.778769390       0  0.778769390  0.778769390
sigma.t3    4.108629567       0  4.108629567  4.108629567
sigma.t4    0.026398046       0  0.026398046  0.026398046
sigma.t5   -0.053484310       0 -0.053484310 -0.053484310
sigma.t6   -0.058172805       0 -0.058172805 -0.058172805
sigma.t7   -0.013939677       0 -0.013939677 -0.013939677
sigma.t8    4.018734506       0  4.018734506  4.018734506
sigma.t9    1.857914515       0  1.857914515  1.857914515

Eigenvalues :  NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 
Numerical rank of Hessian : 0  ( svtol = 1e-05 )
Warning: at least one real parameter is not identifiable

Variance-covariance matrix of beta parameters 
           lambda0 lambda0.t2 lambda0.t3 lambda0.t4 lambda0.t5 lambda0.t6 lambda0.t7 lambda0.t8 lambda0.t9 phi phi.t2 phi.t3 phi.t4
lambda0          0          0          0          0          0          0          0          0          0   0      0      0      0
lambda0.t2       0          0          0          0          0          0          0          0          0   0      0      0      0
lambda0.t3       0          0          0          0          0          0          0          0          0   0      0      0      0
lambda0.t4       0          0          0          0          0          0          0          0          0   0      0      0      0
lambda0.t5       0          0          0          0          0          0          0          0          0   0      0      0      0
lambda0.t6       0          0          0          0          0          0          0          0          0   0      0      0      0
lambda0.t7       0          0          0          0          0          0          0          0          0   0      0      0      0
lambda0.t8       0          0          0          0          0          0          0          0          0   0      0      0      0
lambda0.t9       0          0          0          0          0          0          0          0          0   0      0      0      0
phi              0          0          0          0          0          0          0          0          0   0      0      0      0
phi.t2           0          0          0          0          0          0          0          0          0   0      0      0      0
phi.t3           0          0          0          0          0          0          0          0          0   0      0      0      0
phi.t4           0          0          0          0          0          0          0          0          0   0      0      0      0
phi.t5           0          0          0          0          0          0          0          0          0   0      0      0      0
phi.t6           0          0          0          0          0          0          0          0          0   0      0      0      0
phi.t7           0          0          0          0          0          0          0          0          0   0      0      0      0
phi.t8           0          0          0          0          0          0          0          0          0   0      0      0      0
D                0          0          0          0          0          0          0          0          0   0      0      0      0
D.t2             0          0          0          0          0          0          0          0          0   0      0      0      0
D.t3             0          0          0          0          0          0          0          0          0   0      0      0      0
D.t4             0          0          0          0          0          0          0          0          0   0      0      0      0
D.t5             0          0          0          0          0          0          0          0          0   0      0      0      0
D.t6             0          0          0          0          0          0          0          0          0   0      0      0      0
D.t7             0          0          0          0          0          0          0          0          0   0      0      0      0
D.t8             0          0          0          0          0          0          0          0          0   0      0      0      0
D.t9             0          0          0          0          0          0          0          0          0   0      0      0      0
sigma            0          0          0          0          0          0          0          0          0   0      0      0      0
sigma.t2         0          0          0          0          0          0          0          0          0   0      0      0      0
           phi.t5 phi.t6 phi.t7 phi.t8 D D.t2 D.t3 D.t4 D.t5 D.t6 D.t7 D.t8 D.t9 sigma sigma.t2 sigma.t3 sigma.t4 sigma.t5 sigma.t6
lambda0         0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
lambda0.t2      0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
lambda0.t3      0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
lambda0.t4      0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
lambda0.t5      0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
lambda0.t6      0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
lambda0.t7      0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
lambda0.t8      0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
lambda0.t9      0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
phi             0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
phi.t2          0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
phi.t3          0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
phi.t4          0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
phi.t5          0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
phi.t6          0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
phi.t7          0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
phi.t8          0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
D               0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
D.t2            0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
D.t3            0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
D.t4            0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
D.t5            0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
D.t6            0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
D.t7            0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
D.t8            0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
D.t9            0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
sigma           0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
sigma.t2        0      0      0      0 0    0    0    0    0    0    0    0    0     0        0        0        0        0        0
           sigma.t7 sigma.t8 sigma.t9
lambda0           0        0        0
lambda0.t2        0        0        0
lambda0.t3        0        0        0
lambda0.t4        0        0        0
lambda0.t5        0        0        0
lambda0.t6        0        0        0
lambda0.t7        0        0        0
lambda0.t8        0        0        0
lambda0.t9        0        0        0
phi               0        0        0
phi.t2            0        0        0
phi.t3            0        0        0
phi.t4            0        0        0
phi.t5            0        0        0
phi.t6            0        0        0
phi.t7            0        0        0
phi.t8            0        0        0
D                 0        0        0
D.t2              0        0        0
D.t3              0        0        0
D.t4              0        0        0
D.t5              0        0        0
D.t6              0        0        0
D.t7              0        0        0
D.t8              0        0        0
D.t9              0        0        0
sigma             0        0        0
sigma.t2          0        0        0
 [ reached getOption("max.print") -- omitted 7 rows ]

Fitted (real) parameters evaluated at base levels of covariates 

 lambda0 
 session    estimate SE.estimate         lcl         ucl
       1 0.002023078           0 0.002023078 0.002023078
       2 0.001492948           0 0.001492948 0.001492948
       3 0.001132773           0 0.001132773 0.001132773
       4 0.001488939           0 0.001488939 0.001488939
       5 0.001906845           0 0.001906845 0.001906845
       6 0.001862669           0 0.001862669 0.001862669
       7 0.001956749           0 0.001956749 0.001956749
       8 0.001920909           0 0.001920909 0.001920909
       9 0.001897126           0 0.001897126 0.001897126

 phi 
 session  estimate SE.estimate       lcl       ucl
       1 0.8261636           0 0.8261636 0.8261636
       2 0.8353684           0 0.8353684 0.8353684
       3 0.8371560           0 0.8371560 0.8371560
       4 0.8347676           0 0.8347676 0.8347676
       5 0.8386189           0 0.8386189 0.8386189
       6 0.8399719           0 0.8399719 0.8399719
       7 0.8395522           0 0.8395522 0.8395522
       8 0.8411643           0 0.8411643 0.8411643
       9        NA          NA        NA        NA

 D 
 session    estimate SE.estimate         lcl         ucl
       1 0.016167262           0 0.016167262 0.016167262
       2 0.013686946           0 0.013686946 0.013686946
       3 0.016185843           0 0.016185843 0.016185843
       4 0.013701553           0 0.013701553 0.013701553
       5 0.013652647           0 0.013652647 0.013652647
       6 0.013622849           0 0.013622849 0.013622849
       7 0.013903537           0 0.013903537 0.013903537
       8 0.013791180           0 0.013791180 0.013791180
       9 0.009825789           0 0.009825789 0.009825789

 sigma 
 session  estimate SE.estimate       lcl       ucl
       1   5879175           0   5879175   5879175
       2  12809485           0  12809485  12809485
       3 357825728           0 357825728 357825728
       4   6036441           0   6036441   6036441
       5   5572993           0   5572993   5572993
       6   5546925           0   5546925   5546925
       7   5797790           0   5797790   5797790
       8 327062412           0 327062412 327062412
       9  37687596           0  37687596  37687596

Capthist summary is not revealing any errors and all the rest looks fine. I wonder if there is anything basic that I'm missing...

Super appreciate any help you can provide :)

Thanks,
Gabrielle

Murray Efford

unread,
Nov 23, 2021, 3:51:33 AM11/23/21
to secr
A model with that many parameters needs (much) more data. Start with a constant model. My own preference is to fit PLB models first and worry about density later, if at all. Also, you seem to have no recaptures (or no spatial recaptures) in session 6, so no info to support session-specific estimates of detection parameters in session 6 (it would help to see the output from summary(quoll_f, terse = T) and perhaps m.array(quoll_f)). There may be other problems, but you should start small.

Gabrielle Beca

unread,
Nov 24, 2021, 1:53:32 AM11/24/21
to secr
Hi Murray,

Thanks for your email :)

That's what I get when using "summary(quoll_f, terse = T)"
            1   2   3   4   5   6   7   8   9
Occasions   7   7   7   7   7   7   4   4   4
Detections  4  15  13   6   3   1   2   2   5
Animals     2   6   8   4   1   1   1   1   2
Detectors  48 150 150 150 150 150 200 200 200

And "m.array(quoll_f)"
   R  2  3  4  5  6  7  8  9 NRecap
1  2  0  0  0  0  0  0  0  0      2
2  6     3  0  0  0  0  0  0      3
3  8        3  0  0  0  0  0      5
4  4           0  0  0  0  0      4
5  1              0  0  0  0      1
6  0                 0  0  0      0
7  1                    0  0      1
8  1                       1      0
9  2                              2

I've tried using "JSSAsecrlCL" and leaving D out of the model formula (then, request D as a derived variable afterwards). The results I'm getting don't seem right, but there's something else that I should probably worry about first:

quoll_model1<- openCR.fit(quoll_f, type = 'JSSAsecrlCL', mask=mask_quoll_f)
Warning message:
In openCR.fit(quoll_f, type = "JSSAsecrlCL", mask = mask_quoll_f) :
  multi-session mask provided; using first

> quoll_model1

openCR.fit( capthist = quoll_f, type = JSSAsecrlCL, mask = mask_quoll_f )
openCR 2.2.1, 14:44:54 24 Nov 2021
elapsed time 1.142 minutes

N animals       :  19  
N detections    :  51 
N sessions      :  9 (secondary 54)
Intervals       :  0 0 0 0 0 0 3 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 

Analysis type   :  JSSAsecrlCL 
Model           :  lambda0~1 phi~1 lambda~1 sigma~1 
Fixed (real)    :  none 
Movement model  :  static 
N parameters    :  4 
Log likelihood  :  -436.4813 
AIC             :  880.9627 
AICc            :  883.8198 

Parameter Link 
lambda0   log 
phi       logit 
lambda    log 
sigma     log 

Beta parameters (coefficients) 
             beta   SE.beta        lcl       ucl
lambda0 -7.392795 0.1753763 -7.7365263 -7.049064
phi      1.376652 0.2813675  0.8251815  1.928122
lambda  -1.222904 0.0000000 -1.2229044 -1.222904
sigma   59.895997 0.0000000 59.8959965 59.895997

Eigenvalues :  1 0.38807 0 0 
Numerical rank of Hessian : 2  ( svtol = 1e-05 )
Warning: at least one real parameter is not identifiable

Variance-covariance matrix of beta parameters 
            lambda0         phi lambda sigma
lambda0 0.030756852 0.001089842      0     0
phi     0.001089842 0.079167670      0     0
lambda  0.000000000 0.000000000      0     0
sigma   0.000000000 0.000000000      0     0

Fitted (real) parameters evaluated at base levels of covariates 

 lambda0 
 session     estimate  SE.estimate          lcl          ucl
       1 0.0006156727 0.0001079744 0.0004365855 0.0008682215
       2 0.0006156727 0.0001079744 0.0004365855 0.0008682215
       3 0.0006156727 0.0001079744 0.0004365855 0.0008682215
       4 0.0006156727 0.0001079744 0.0004365855 0.0008682215
       5 0.0006156727 0.0001079744 0.0004365855 0.0008682215
       6 0.0006156727 0.0001079744 0.0004365855 0.0008682215
       7 0.0006156727 0.0001079744 0.0004365855 0.0008682215
       8 0.0006156727 0.0001079744 0.0004365855 0.0008682215
       9 0.0006156727 0.0001079744 0.0004365855 0.0008682215

 phi 
 session  estimate SE.estimate       lcl       ucl
       1 0.7984527  0.04527934 0.6953351 0.8730414
       2 0.7984527  0.04527934 0.6953351 0.8730414
       3 0.7984527  0.04527934 0.6953351 0.8730414
       4 0.7984527  0.04527934 0.6953351 0.8730414
       5 0.7984527  0.04527934 0.6953351 0.8730414
       6 0.7984527  0.04527934 0.6953351 0.8730414
       7 0.7984527  0.04527934 0.6953351 0.8730414
       8 0.7984527  0.04527934 0.6953351 0.8730414
       9        NA          NA        NA        NA

 lambda 
 session  estimate SE.estimate       lcl       ucl
       1 0.2943739           0 0.2943739 0.2943739
       2 0.2943739           0 0.2943739 0.2943739
       3 0.2943739           0 0.2943739 0.2943739
       4 0.2943739           0 0.2943739 0.2943739
       5 0.2943739           0 0.2943739 0.2943739
       6 0.2943739           0 0.2943739 0.2943739
       7 0.2943739           0 0.2943739 0.2943739
       8 0.2943739           0 0.2943739 0.2943739
       9        NA          NA        NA        NA

 sigma 
 session     estimate SE.estimate          lcl          ucl
       1 1.029202e+26           0 1.029202e+26 1.029202e+26
       2 1.029202e+26           0 1.029202e+26 1.029202e+26
       3 1.029202e+26           0 1.029202e+26 1.029202e+26
       4 1.029202e+26           0 1.029202e+26 1.029202e+26
       5 1.029202e+26           0 1.029202e+26 1.029202e+26
       6 1.029202e+26           0 1.029202e+26 1.029202e+26
       7 1.029202e+26           0 1.029202e+26 1.029202e+26
       8 1.029202e+26           0 1.029202e+26 1.029202e+26
       9 1.029202e+26           0 1.029202e+26 1.029202e+26

> derived(quoll_model1)
Total number observed 19 
Parameters in model lambda0, phi, lambda, sigma 
Superpopulation density 0.06320149 per ha 
Session-specific counts and estimates:

 stratum session n R m r z time   lambda0    phi lambda     sigma          b       f gamma         D
       1       1 2 2 0 0 0    0 0.0006157 0.7985    NaN 1.029e+26  2.007e+00     NaN    NA 1.268e-01
       1       2 6 6 0 3 0    3 0.0006157 0.7985 0.2944 1.029e+26 -9.704e-01 -0.5041   NaN 3.236e-03
       1       3 8 8 3 3 0    4 0.0006157 0.7985 0.2944 1.029e+26 -2.581e-02 -0.5041 2.712 9.525e-04
       1       4 4 4 3 0 0    5 0.0006157 0.7985 0.2944 1.029e+26 -7.597e-03 -0.5041 2.712 2.804e-04
       1       5 1 1 0 0 0    6 0.0006157 0.7985 0.2944 1.029e+26 -2.236e-03 -0.5041 2.712 8.254e-05
       1       6 1 0 0 0 0    7 0.0006157 0.7985 0.2944 1.029e+26 -6.583e-04 -0.5041 2.712 2.430e-05
       1       7 1 1 0 0 0    8 0.0006157 0.7985 0.2944 1.029e+26 -1.938e-04 -0.5041 2.712 7.153e-06
       1       8 1 1 0 1 0    9 0.0006157 0.7985 0.2944 1.029e+26 -5.705e-05 -0.5041 2.712 2.106e-06
       1       9 2 2 1 0 0   10 0.0006157     NA     NA 1.029e+26 -1.679e-05      NA 2.712 6.198e-07

Any thoughts on this? 

Thanks for any help you can provide,

Gabrielle

Murray Efford

unread,
Nov 24, 2021, 12:05:06 PM11/24/21
to Gabrielle Beca, secr
1. You do not have enough data, I'm afraid
2. You might squeeze something out of what you have with a multi-session analysis in 'secr' (not 'openCR'), and some heroic assumptions (detection parameters and density constant over time or fixed at 'known' values etc.). But this is really not what the methods were designed for.
3. The mask warning from openCR flags that you have provided multiple masks when openCR uses just one.


--
You received this message because you are subscribed to the Google Groups "secr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to secrgroup+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/secrgroup/23901aad-78d1-4c25-b37b-e044bd0fe101n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages