estimating p0 by mark-recapture using gamma key function

4 views
Skip to first unread message

Caroline Sauvé

unread,
Dec 17, 2024, 10:56:53 AM (4 days ago) Dec 17
to distance-sampling
Hi,
I am trying to fit a MRDS model to double-observer data using a gamma key function to estimate p0 primary and p0 secondary. When fitting the detection function using method='ds',  I get a model that appears very reasonnable:

DF_Skey_ObserverTxt <- ddf(method = "ds", dsmodel = ~mcds(key = gamma, formula = ~ Primary_Observer  , adj.series = NULL, adj.order = NULL), data = data_beluga, meta.data = list(width = 1687))

> summary(DF_Skey_ObserverTxt) Summary for ds object Number of observations : 208 Distance range : 0 - 1687 AIC : 3006.366 Optimisation : mrds (nlminb) Detection function: key function Detection function parameters Scale coefficient(s): estimate se (Intercept) 6.6354876 0.07249513 Primary_ObserverCS 0.5119252 0.18735003 Shape coefficient(s): estimate se (Intercept) -0.4285859 0.3067485 Estimate SE CV Average p 0.494539 0.02776937 0.05615203 N in covered region 420.593732 31.65851626 0.07527101

(also see detection curve attached)

However, when fitting the MRDS io model to the exact same dataset, there seems to be a problem with the gamma function, and p0 values are not estimated:

MRDS_KeyForm_PrimaryVSSec <- ddf(method= "io",
                            dsmodel= ~mcds(key=gamma,
                                           formula= ~
Primary_Observer,
                                           adj.series = NULL,
                                           adj.order = NULL),
                            mrmodel= ~glm(~distance + ObserverDist),
                            data= data_beluga, meta.data=list(width = 1687))

> summary(MRDS_KeyForm_PrimaryVSSec) Summary for io.fi object Number of observations : 208 Number seen by primary : 176 Number seen by secondary : 130 Number seen by both : 98 AIC : 425.7071 Conditional detection function parameters: estimate se (Intercept) 1.8571187195 0.4365211887 distance 0.0002642592 0.0003808093 ObserverDist -0.8909764006 0.2099302620 Estimate SE CV Average primary p(0) NaN NaN NaN Average secondary p(0) NaN NaN NaN Average combined p(0) NaN NaN NaN Summary for ds object Number of observations : 208 Distance range : 0 - 1687 AIC : 3006.366 Optimisation : mrds (nlminb) Detection function: key function Detection function parameters Scale coefficient(s): estimate se (Intercept) 6.6354876 0.07249513 Primary_ObserverCS 0.5119252 0.18735003 Shape coefficient(s): estimate se (Intercept) -0.4285859 0.3067485 Estimate SE CV Average p 0.494539 0.02776937 0.05615203 Summary for io object Total AIC value : 3432.073 Estimate SE CV Average p NaN NaN NaN N in covered region NaN NaN NaN

I suspect this has something to do with the shape parameter of the gamma, since when I try and run the apex.gamma function I get 'NaN' and

scalevalue(ddfobj$shape$parameters, ddfobj$shape$dm)

returns 0.6514296, which is smaller than 1 and leads to a negative value in the expression (((key.shape - 1)/exp(1))^(key.shape - 1)).
Also, running the same model on the same data with a HR key function returns the expected p0 values. The gamma by far yields the best fit to the data so it would be too bad to have to use a HR and left-truncate the data if I can't use the gamma. Any suggestion how I could fix this?
Thank you very much,
Caroline

detection_curve.png

Len Thomas

unread,
Dec 17, 2024, 12:43:31 PM (4 days ago) Dec 17
to distance...@googlegroups.com
Hi Caroline,

I assume this is line transect aerial survey data, hence the dip in
detections at smaller perpendicular distances?

I'll be happy to have a look at this, but it will be much easier if you
can send me a sample of data and code, off the list (just mail my
University address) and I'll check it out. Once we have a solution we
can post back to the list what it was.

Cheers, Len
> returns0.6514296, which is smaller than 1 and leads to a negative value
> in the expression (((key.shape - 1)/exp(1))^(key.shape - 1)).
> Also, running the same model on the same data with a HR key function
> returns the expected p0 values. The gamma by far yields the best fit to
> the data so it would be too bad to have to use a HR and left-truncate
> the data if I can't use the gamma. Any suggestion how I could fix this?
> Thank you very much,
> Caroline
>
> --
> 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
> <mailto:distance-sampl...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/
> distance-sampling/5c3fc94d-c56a-4136-8444-
> d0fc1a5a86ccn%40googlegroups.com <https://
> eur01.safelinks.protection.outlook.com/?
> url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fdistance-
> sampling%2F5c3fc94d-c56a-4136-8444-
> d0fc1a5a86ccn%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C02%7Clen.thomas%40st-andrews.ac.uk%7Cd6e9286f2c504767150d08dd1eb37289%7Cf85626cb0da849d3aa5864ef678ef01a%7C0%7C0%7C638700478404267780%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C80000%7C%7C%7C&sdata=fazCBCpZ4AQb1YFHyif3kRHDAo3A7EqCmM8DXEovbfg%3D&reserved=0>.

--
Len Thomas (he/him) len.t...@st-andrews.ac.uk lenthomas.org @len_thom
Centre for Research into Ecological and Environmental Modelling
and School of Mathematics and Statistics
The Observatory, University of St Andrews, Scotland KY16 9LZ
Office: UK+1334-461801 Admin: UK+1334-461842

While I may be sending this email outside of my normal office hours,
I have no expectation to receive a reply outside of yours.

The University of St Andrews is a charity
registered in Scotland, No SC013532.

Reply all
Reply to author
Forward
0 new messages