ds() failing to converge on estimate?

17 views
Skip to first unread message

Ariek Norford

unread,
Aug 3, 2025, 1:52:34 PMAug 3
to distance-sampling
I am running the ds() function about 1000 times as part of a simulation study. It works fine for many of the simulated datasets, however, I have noticed that occasionally it gets stuck (stays like this for > 10 hours and then R crashes) at this point: 

Fitting half-normal key function
AIC= 331.062
Fitting half-normal key function with cosine(2) adjustments
AIC= 333.062

Half-normal key function selected.

Is it failing to converge? If so is there a way to have it stop if there is no convergence?

Here is my ds function for context: ds(data = data, key = c("hn","hr","unif"), adjustment =  c("cos","herm","poly"), region_table = region_table, sample_table = sample_table, obs_table = obs_table, initial_values = NULL)

Eric Rexstad

unread,
Aug 4, 2025, 3:18:06 AMAug 4
to distance-sampling, Ariek Norford
Ariek

Your diagnosis is probably correct that convergence failures are causing your problems. Here are a few suggestions

From: 'Ariek Norford' via distance-sampling <distance...@googlegroups.com>
Sent: 03 August 2025 18:52
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] ds() failing to converge on estimate?
 
--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/distance-sampling/e62912dd-32b3-4db6-9d60-43da958f70den%40googlegroups.com.

Ariek Norford

unread,
Aug 11, 2025, 9:09:30 AMAug 11
to distance-sampling
Thank you for these suggestions! I was able to get my code running.
Reply all
Reply to author
Forward
0 new messages