Error in integrate

20 views
Skip to first unread message

Milena Ribeiro

unread,
Feb 21, 2026, 3:01:10 PMFeb 21
to secr
Good afternoon, everyone,

I am working with the secr package using jaguar camera trap data. While using the secr.fit function to generate models, I encountered the following error:

Error in integrate(integrand2, lower = trapspacing/2^0.5, upper = Inf) :
the integral is probably divergent

Warning message:
could not perform bias check

Does anyone know why I might be encountering this error when using this function?

Murray Efford

unread,
Feb 21, 2026, 3:38:22 PMFeb 21
to secr
Hello there
After fitting a model using a specified buffer width (rather than a user-provided mask), secr.fit() attempts to check whether the buffer width is large enough to avoid truncation bias (it won't be for jaguars if you have forgotten to replace the default). The check uses an undocumented and ad hoc  approximation that does not work for all detector configurations. You seem to have hit that problem. If everything else is OK then just double check that you have used a sensible buffer width. The check can be suppressed by setting biasLimit = NA in the call to secr.fit.
Murray

Milena Ribeiro

unread,
Feb 24, 2026, 1:38:03 PMFeb 24
to secr
Hi Murray,

Thank you for the suggestion. I suppressed the check using the biasLimit = NA argument and it worked well.

I believe the error occurred for the reason you mentioned. My sampling design consists of only 13 sampling units with an average spacing of 500m. Since the target species has a large home range and the number of sampling units is relatively small, are there any implications to significantly increasing the buffer size (e.g., to 30,000m)? This would include areas used by the species that were not directly sampled.

Thank you again for your attention.
Sorry for not including the previous email to everyone.


Milena.

Murray Efford

unread,
Feb 24, 2026, 2:46:53 PMFeb 24
to secr
Yes. There are two separate issues - the spatial extent of sampling and the buffer size used in the analysis. Both need to reflect the mobility (home range) of the target species. I assume the extent of sampling was adequate (too late to change that!). Choose a buffer size large enough to include the activity centres of all animals that might have been detected, for convenience some small multiple of the half-normal sigma  (e.g. 4.sigma). For jaguar that may well be 30km. That applies regardless of the extent of sampling.
Murray

Milena Ribeiro

unread,
Feb 25, 2026, 3:21:46 PMFeb 25
to secr
Thank you for the feedback, Murray. It really helped me with my decision-making. The analyses worked well with a larger buffer size.

Best regards,
Milena.
Reply all
Reply to author
Forward
0 new messages