issues with ds function?

36 views
Skip to first unread message

Pamela Narváez

unread,
Jul 13, 2021, 12:55:31 PM7/13/21
to distance-sampling
Hi all,

I've been trying to run some simple code with the ds function (I've used this code before with no issues) but for some reason, it doesn't work anymore (It looks like it doesn't work for any of the species I'm doing). I've tried multiple things and I've shared the code with other people and they've had the same issues as me. I'm not sure what I'm doing wrong since it was working before; any help will be greatly appreciated!

Here's the code:
sp1<-read.csv(file="ds_sp1.csv", sep=",", h=T)
sp1$Region.Label<-as.factor(sp1$Region.Label)
conversion <- convert_units("meter", "meter", "square kilometer")
DS_sp1<- ds(data = sp1, key="hn", convert.units = conversion)

This is the error I get after running the ds():
Starting AIC adjustment term selection.
Fitting half-normal key function
Key only model: not constraining for monotonicity.

 Problems with integration. integral <=0. Setting integral to 1E-25

 Problems with integration. integral <=0. Setting integral to 1E-25

 Problems with integration. integral <=0. Setting integral to 1E-25
Error in detfct.fit.opt(ddfobj, optim.options, bounds, misc.options, fitting = "key") : 
  No convergence.


All models failed to fit!

Error in ds(data = sp1, key = "hn", convert.units = conversion) : 
  No models could be fitted.


Thanks!

Pamela

Eric Rexstad

unread,
Jul 13, 2021, 1:40:10 PM7/13/21
to Pamela Narváez, distance-sampling

Pamela

There's no reason to suspect there is something wrong with the code.  The messages you are receiving indicate the function is having a hard time with the perpendicular distances you are giving it.

Have you done a simple plot of the perpendicular distance distribution to which you are trying to fit the half normal detection function?  The data may be a sufficiently bizarre shape that a detection function cannot be fitted.  Have a look at the plot and see what it tells you.  If the data look "well behaved", then perhaps we need a conversation off-list about what else to examine.

--
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/5855228e-3591-4971-9464-bd9a760585f8n%40googlegroups.com.
-- 
Eric Rexstad
Centre for Ecological and Environmental Modelling
University of St Andrews
St Andrews is a charity registered in Scotland SC013532
Reply all
Reply to author
Forward
0 new messages