AIC comparisons between the software Distance and ds function in R

121 views
Skip to first unread message

Marjorie Bison

unread,
Dec 5, 2018, 9:57:43 AM12/5/18
to distance-sampling
Hi Distance group,

I am a beginner in distance sampling analysis, so sorry for the naive questions.
I am dealing with mountain herbivores (ibex) data (736 observations) that have been sampled with line transects. The final aim of our projet is to estimate the population abundance to study demographic evolution of the population with time.

My issue relates to the AIC values calculated with the software Distance and the ds function in R. I wanted to compare the two results to be sure I did the right thing in R.

In R, my script looks like :
hr.ip <- ds(d , transect  = "line" , dht.group = F , convert.units = 0.001 , key = "hr" , truncation = list(left = "0%" , right = "5%") , method = "BFGS" , formula = ~ transect)
-> Before, I compared different models and this one above has the lowest AIC (effect of the transect).
The AIC equals 7950.633.

When I do the same thing (MCDS model with transect as covariate, same key function, same truncation) in the software Distance, the AIC equals 7960.2388.

Why is there such a difference ? Consequently, it does not give the same probabilities of detection...

When I do the same thing but with the "halfnormal" function, it gives the same AIC between the software Distance and R (ans so the same probabilities of detection).

Have you ever had this problem ? Is there something related to the hazard rate function ?

If anyone have an idea and can help me, I would be very grateful !

Thank you
Cheers

Marjorie


 

Eric Rexstad

unread,
Dec 5, 2018, 10:11:40 AM12/5/18
to Marjorie Bison, distance-sampling
Marjorie

Welcome to the list.  I'll answer two questions.

First the question you asked:  why different AIC for a model fit using R and a model fit using Distance.  The answer is that the likelihood values are different according to the two different fitting engines.  The optimisation used to estimate the parameters of the hazard rate detection function are not the same, and for complex models, will produce slightly different estimates.  Because the hazard rate model is more complex than the half normal, the differences in the fitting algorithms are likely to be more pronounced with the hazard rate models.  This is a situation with which we are familiar and occurs in other data sets we have analysed.

The question you did not ask:  I've not seen fitting of detection functions with covariates for transects.  Often it is the case that there are insufficient detections per transect to be able to fit such models.  It is also common for there to be a large number of transects such that a large number of parameters are associated with a factor covariate for transect.
--
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 post to this group, send email to distance...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/8dc40d0b-eb51-4d36-a6a4-62da9bd2679c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marjorie Bison

unread,
Dec 5, 2018, 10:32:11 AM12/5/18
to er...@st-andrews.ac.uk, distance...@googlegroups.com
Thank you for your quick answer Eric !

ok, so do you usually use/publish the estimates from R or from Distance ?

I'm note sure to understand the point of the second paragraph. Do you mean that if I have enough detections per transect I should perform a model for each transect independantly ? (7 transects with 44 to 164 detections).

Thank you again !
--

Eric Rexstad

unread,
Dec 5, 2018, 10:38:50 AM12/5/18
to Marjorie Bison, distance...@googlegroups.com
Marjorie

The optimisation engine inside Distance was constructed specifically to perform the sort of optimisation performed for fitting detection functions.  The optimisation engine used by the ds() function in R is a general-purpose optimiser.  So, if it was me, I would report the results from Distance; that is not to say the optimiser in R is poor.

My second point was that it is unusual to have a) so few transects (7) as to consider treating transect as a detection function factor covariate and b) so many detections per transect (I presume this is from multiple visits to the transects).  I noted that I'd not seen a detection function model with transect as a covariate.  That might be the cause of potential fitting problems you might be having.

Stephen Buckland

unread,
Dec 5, 2018, 10:56:34 AM12/5/18
to Eric Rexstad, Marjorie Bison, distance...@googlegroups.com

Adding to Eric’s comments, there is unlikely to be an advantage to fitting transect as a covariate unless you are estimating density separately for each transect.  Pooling robustness means that you estimate overall density (or abundance) without bias even if the detection function differs by transect – assuming a good survey design, and assuming assumptions hold.  Nevertheless, you may want to fit covariates to the detection function, e.g. observer or habitat, which does then allow the detection function to differ by transect.  Using AIC to investigate different covariate models helps to avoid over-parameterizing.  Given that you have so many detections for each transect, then it may be reasonable to include transect as a factor-type covariate in at least one of your models.

 

Steve Buckland

Marjorie Bison

unread,
Dec 6, 2018, 4:11:29 AM12/6/18
to st...@st-andrews.ac.uk, Eric.R...@st-andrews.ac.uk, distance...@googlegroups.com
Thank you for the clarification Steve and Eric.

Indeed, we visited the transects multiple times (4 repeats per year during 5 years) which explains the high number of detections.
We compared different models with different covariates and it is the one with transect as a factor covariate that fits the best (perhaps explained by local habitat differences between the transects).

Cheers
Marjorie
Reply all
Reply to author
Forward
0 new messages