Missing mask in conditional open models

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

Missing mask in conditional open models

Postby tmcdonald » Mon Jun 07, 2021 4:06 pm

I am getting the following "missing mask" error when estimating conditional open SECR models and asking for derived parameters:

Code: Select all
Error in makegkParallelcpp(as.integer(object$detectfn), as.integer(.openCRstuff$sigmai[type]),  :
  argument "mask" is missing, with no default


Unconditional SECR models do not produce this error. My question is whether this error correctly prevents estimation of derived parameters from conditional models, or whether this is a bug. I think derived parameters can be estimated from a conditional model, and hence I suspect this error is a bug. Apologies if I am wrong.

Here is a minimal working example using the ovenbird data:

Code: Select all
fit <- openCR.fit(ovenCH, type="JSSAsecrbCL", mask=ovenmask)
Warning message:
In openCR.fit(ovenCH, type = "JSSAsecrbCL", mask = ovenmask) :
  multi-session mask provided; using first
> fit

openCR.fit( capthist = ovenCH, type = JSSAsecrbCL, mask = ovenmask )
openCR 2.0.2, 13:42:36 07 Jun 2021
elapsed time 0.275 minutes


N animals       :  70 
N detections    :  192
N sessions      :  5 (secondary 49)
Intervals       :  0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

Analysis type   :  JSSAsecrbCL
Model           :  lambda0~1 phi~1 b~1 sigma~1
Fixed (real)    :  none
Movement model  :  static
N parameters    :  4
Log likelihood  :  -1324.635
AIC             :  2657.271
AICc            :  2657.886

Parameter Link
lambda0   log
phi       logit
b         mlogit
sigma     log

Beta parameters (coefficients)
              beta    SE.beta        lcl        ucl
lambda0 -3.9477323 0.14309045 -4.2281845 -3.6672802
phi      0.1555693 0.24528045 -0.3251715  0.6363102
b       -0.8188841 0.29428890 -1.3956798 -0.2420885
sigma    4.6398200 0.08367938  4.4758115  4.8038286

Eigenvalues :  1 0.23694 0.09405 0.05784
Numerical rank of Hessian : 4  ( svtol = 1e-05 )

<REMAINING OUTPUT CLIPPED>

> derived(fit)
Error in makegkParallelcpp(as.integer(object$detectfn), as.integer(.openCRstuff$sigmai[type]),  :
  argument "mask" is missing, with no default



Here is the unconditional model:

Code: Select all
>  fit <- openCR.fit(ovenCH, type="JSSAsecrb", mask=ovenmask)
Warning message:
In openCR.fit(ovenCH, type = "JSSAsecrb", mask = ovenmask) :
  multi-session mask provided; using first
> derived(fit)
Total number observed 70
Parameters in model lambda0, phi, b, superD, sigma
Superpopulation density 2.041739 per ha
Session-specific counts and estimates:

 stratum session  n  R  m  r z time lambda0    phi      b superD sigma lambda      f  gamma      D
       1       1 20 20  0 12 0    0  0.0193 0.5388 0.3618  2.042 103.5 0.9797 0.4409     NA 0.7388
       1       2 22 22  9 10 3    1  0.0193 0.5388 0.1595     NA 103.5 0.9889 0.4500 0.5500 0.7238
       1       3 26 26 12  6 1    2  0.0193 0.5388 0.1595     NA 103.5 0.9939 0.4551 0.5449 0.7157
       1       4 19 19  4  5 3    3  0.0193 0.5388 0.1595     NA 103.5 0.9967 0.4579 0.5421 0.7114
       1       5 16 15  8  0 0    4  0.0193     NA 0.1595       NA 103.5     NA     NA 0.5406 0.7090
tmcdonald
 
Posts: 8
Joined: Wed Dec 05, 2007 3:41 pm
Location: Laramie, WY

Re: Missing mask in conditional open models

Postby murray.efford » Thu Jun 10, 2021 10:59 pm

Must be a bug - working on it
Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: Missing mask in conditional open models

Postby murray.efford » Fri Jun 11, 2021 5:16 am

Yes, definitely a bug introduced in openCR.esa() the latest release. I have put a patched version of the Windows zip file here and the source tar.gz here. These may change before 2.0.3 is sent to CRAN (and I'll hold off on that for a few weeks). Thanks for reporting this, and for the tidy example that made it easy to fix.
Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: Missing mask in conditional open models

Postby tmcdonald » Tue Jun 29, 2021 5:52 pm

Thank you Murry for the bug fix and timely reply. I an in the process of testing and will report back any further issues.
tmcdonald
 
Posts: 8
Joined: Wed Dec 05, 2007 3:41 pm
Location: Laramie, WY


Return to analysis help

Who is online

Users browsing this forum: No registered users and 13 guests