Coefficient of variation in DSM

78 views
Skip to first unread message

Constanza Ordoñez

unread,
Jul 14, 2023, 11:39:10 AM7/14/23
to distance-sampling
Hello colleagues! As part of my PhD thesis I'm working on some dsm for a dolphin species in southern Argentina. I'm having trouble calculating the variance estimation, I keep receiving an error. I was doing it with the following code:
 
preddata.varprop <- split(prediction.data, 1:nrow(prediction.data))
dsm.xy.varprop <- dsm_var_prop(model1, pred.data = preddata.varprop,
                               off.set = prediction.data$AREA)
summary(dsm.xy.varprop)


This is what came out from the code: 
Error in dsm_var_prop(modelo.t14, pred.data = preddata.varprop, off.set = prediction.data2$AREA) :
No detection function in this analysis, use dsm_var_gam

I changed to dsm_var_gam and I got this: 

> summary(dsm.xy.varprop)
Summary of uncertainty in a density surface model calculated
 analytically for GAM, with delta method
Approximate asymptotic confidence interval:
      2.5%       Mean      97.5%
  45.63008  360.08097 2841.50936
(Using log-Normal approximation)
Point estimate                 : 360.081
 
Error in round(x$gam.cv, 4) :
  non-numeric argument to mathematical function


I keep receiving that error, do you have an idea of how to correct it? 
My selected model has a tweedie distribution and three covariates: 

model1 <- dsm(count~s(x,y, k=15)+s(distcosta, k=10)+s(rug, k=10),dummy_ddf(observation.data$object,width=600),segment.data,observation.data,family=tw(), method="REML")

Many thanks in advance

Eric Rexstad

unread,
Jul 14, 2023, 11:57:05 AM7/14/23
to Constanza Ordoñez, distance-sampling
Constanza

From your call to dsm​ (using the dummy_ddf​ argument) it appears you are working with strip transect data, correct?  That might explain the first message saying

no detection function in this analysis

I don't have experience working with strip transect data in conjunction with dsm_var_gam​. Perhaps the summary()​ function runs into some kind of trouble.
You do not include your call to dsm_var_gam​ in your code. Is the object dsm.xy.varprop​ containing information from calling dsm_var_gam​? If so, you might be able to examine the object directly, without summary​. What does that tell you?

From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Constanza Ordoñez <ordonezc...@gmail.com>
Sent: 14 July 2023 16:39
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] Coefficient of variation in DSM
 
--
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/6f2b3f23-6a29-4c8b-ba85-95864f2ab3abn%40googlegroups.com.

Constanza Ordoñez

unread,
Jul 18, 2023, 10:52:11 AM7/18/23
to distance-sampling
Hi, Eric! thanks for the answer. Yes, I'm working with strip transect data. When I call the object dsm.xy.varprop directly I get the same as the summary: 

> dsm.xy.varprop
Summary of uncertainty in a density surface model calculated
analytically for GAM, with delta method
Approximate asymptotic confidence interval:
2.5%       Mean      97.5%
  45.63008  360.08097 2841.50936
(Using log-Normal approximation)
Point estimate                 : 360.081
Error in round(x$gam.cv, 4) :
  non-numeric argument to mathematical function 

Is that what you were asking for? 

Thanks for your time

Constanza 
Reply all
Reply to author
Forward
0 new messages