Error from secrBVN and region.N

44 views
Skip to first unread message

Nianfan Ding

unread,
Feb 4, 2023, 10:17:22 AM2/4/23
to secr
Hi all,

I made a multi-session capthist with multiple trap files (unique trap layouts). Then I fitted several full likelihood models with anisotropic.fit, e.g., D~session + slope g0~bk

But when I used region.N to get abundance, I got an error saying:

> region.N(secr19)
Error in coords %*% rm : non-conformable arguments.

Here is my RData (Don't know if it's the proper way to send data here):


In my case, seems like all models (secr13, secr15, ..., secr19) fitted by anisotropic.fit returned this error.

I'd like to know if region.N doesn't apply to secrBVN or I did something wrong.

Many thanks!!

Murray Efford

unread,
Feb 5, 2023, 8:37:31 PM2/5/23
to secr
Well, secrBVN is a rather specialised package meant to support the paper in Ecology (2019), and only available on GitHub, so I'm not promising it will be kept compatible with current secr, but...

The reason region.N() didn't work for you turns out to be two obscure bugs, one concerning multi-session data with varying detectors and one concerning user-specified distance functions (secrBVN uses a custom distance function based on geoR). These both needed to be fixed irrespective of secrBVN, so thanks for reporting the issue with examples that made it easy to trace the problem.

I think I have fixed the issues in a pre-release version. This is available as source code at www.otago.ac.nz/density/zip/secr_4.5.9.tar.gz and as windows binary at www.otago.ac.nz/density/zip/secr_4.5.9.zip (expect further changes in the pre-release version before it is submtted to CRAN).

The problem arose only with se.N = TRUE. I now get, e.g.
> region.N(secr19)
$BFG
    estimate SE.estimate      lcl     ucl n
E.N 8.634997    8.937335 1.621495 45.9842 1
R.N 8.233575    8.440436 2.175710 45.5047 1

$HM
    estimate SE.estimate      lcl      ucl  n
E.N 53.08987    16.41645 29.36220 95.99193 18
R.N 58.43681    14.71088 38.26196 98.69976 18

$HTB
    estimate SE.estimate      lcl      ucl  n
E.N 87.17883     29.7005 45.53477 166.9087 16
R.N 78.95101     28.1947 43.23013 161.5311 16

$JMSE
    estimate SE.estimate      lcl      ucl n
E.N 9.091009    5.480828 3.052517 27.07485 3
R.N 9.469894    4.576949 4.856461 25.54802 3

$ML
    estimate SE.estimate      lcl      ucl n
E.N 14.95641    7.344921 6.014181 37.19448 5
R.N 15.25011    6.244313 8.408146 35.82756 5

$MQ
    estimate SE.estimate      lcl     ucl n
E.N 11.64179    7.180775 3.825562 35.4278 3
R.N 11.48572    6.318366 5.308669 34.1900 3

$QT
    estimate SE.estimate      lcl      ucl n
E.N 11.76942    7.138872 3.929332 35.25261 3
R.N 12.08277    6.260518 5.676164 33.82647 3

$SW
    estimate SE.estimate       lcl      ucl n
E.N 21.13093    8.777565  9.667457 46.18757 7
R.N 22.68214    7.477614 13.458521 45.07828 7

$WN
    estimate SE.estimate      lcl      ucl n
E.N 33.12519    15.07994 14.14987 77.54689 6
R.N 34.08229    13.93841 17.19389 76.45050 6

$WS
    estimate SE.estimate      lcl      ucl n
E.N 35.21009    17.43525 14.06231 88.16121 5
R.N 36.56103    16.39444 17.10933 87.25871 5
Murray

Nianfan Ding

unread,
Feb 9, 2023, 9:56:03 PM2/9/23
to secr
Many thanks Murray!!
Reply all
Reply to author
Forward
0 new messages