Errors using Package Distance

32 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Nolan Helmstetter

ungelesen,
08.09.2022, 19:04:2408.09.22
an distance-sampling
I've been getting several errors trying to use package distance to estimate detection probability (i.e., the ds function). I get a couple of errors  both when I do not truncate or use cutpoints (i.e., group distance data).

When I do not truncate or use cutpoints i get the following

Warning in if (all(class(data) != "data.frame") & class(data) != "list") { :
  the condition has length > 1 and only the first element will be used
Starting AIC adjustment term selection.
Fitting hazard-rate key function
Key only model: not constraining for monotonicity.
AIC= 11258.527
Fitting hazard-rate key function with cosine(2) adjustments
AIC= 11260.364

When I do I get a myriad of errors (including the error above). The following error pops up probably 100 times... or perhaps as many times as I have samples.

gosolnp-->warning: Inf detected in function call...check your function
Warning in .safefun(x, fun, gosolnp_parnames, ...) :
gosolnp-->warning: Inf detected in function call...check your function

Attached is an example of my data. Code is below....

corvid_test<-ds(Distance_Simp,transect="point", key ="hr")
corvid_test<-ds(Distance_Simp,truncation=950,cutpoints=c(0,150,250,350,450,550,650,750,850,950),transect="point", key ="hr")




example_data.csv

Eric Rexstad

ungelesen,
09.09.2022, 05:01:1609.09.22
an Nolan Helmstetter, distance-sampling
Nolan

Thanks for sending along a bit of your data; I presume this just a few records rather than the full data set.  The short answer to your question about the warning messages: the ds​ function tries many different starting values as it begins the maximum likelihood search for the optimal parameters in the detection function model you have asked to fit.

The fitting problem is more difficult for hazard rate key functions than for half normal key functions.  The problem is also more difficult for point transect data than for line transect data.  The messages you see relate to the difficulty the ds​ function is having fitting the hazard rate model to the data, particularly when the data are binned.

The portion of data you sent along has been keeping my computer busy for several minutes as I write this attempting to fit the hazard rate model to binned distances.  I presume that is because the data are particularly difficult to fit.  That consistent with the warnings being sent by the software.

More recent versions of the Distance package (1.0.6 on CRAN) has muffled the volume of warning messages reported, but nevertheless the fitting challenges exist. From the data you have provided, it appears it will be difficult to produce reliable estimates from these data.

If you wish to have me look at a more extensive version of your data, you can contact me off-list.


From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Nolan Helmstetter <nhe...@gmail.com>
Sent: 09 September 2022 00:04
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] Errors using Package Distance
 
--
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 on the web visit https://groups.google.com/d/msgid/distance-sampling/69f02c36-58c4-4d34-b80d-5c28813174e4n%40googlegroups.com.
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten