Spatial density queries

92 views
Skip to first unread message

Jamie McKaughan

unread,
Oct 7, 2022, 6:08:41 AM10/7/22
to secr
Dear team,

I was hoping to clarify a few elements of my understanding with you, specifically regarding covariates - I have read a lot but I think have just confused myself now. I am estimating leopard density in commercial farmland and I would like to also look at what environmental/anthropological factors might impact their spatial density/distribution.

Reading the various guide PDFs and other papers, I understand I can add trap specific environmental covariates to the trap file and model their influence on g0, and hence their potential influence on overall density. My understanding is that this just provides me with how that covariate influences detectability at each site and adjusts density estimates accordingly? Whereas for modelling influence of covariates on spatial density more widely across the survey area I would need to add the covariates to my mask rather than trap file? In order to add them to the mask and model influence on spatial density however, I need to have data on the covariates for all of the survey area - is that correct? For example, I know about whether lethal control is used or not on all the properties I had cameras on, but not necessarily all those in between/surrounding the immediate camera survey site, so would I be right in saying that my models would not run successfully/be useful if I tried to use this as a covariate in my mask to assess spatial density? But would still be able to look at overall density influence of this covariate by including it in the trap file? Whereas something like NDVI vegetation data across my whole survey area, including buffer, would be able to be used in a mask?

Slightly separate to this, I saw in someone's code recently (subset below) two options of models, measuring influence of covariates on g0 and on density:
### g0
# null
mLeopardg01 <- secr.fit(cptr_hst, model=g0~1, mask=mask5, detectfn=2, CL=TRUE)
# is magnitude of detection a learned response
mLeopardg02 <- secr.fit(cptr_hst, model=g0~b, mask=mask5, detectfn=2, CL=TRUE)
# is magnitude of detection affected by lethal control
mLeopardg03 <- secr.fit(cptr_hst, model=g0~Control, mask=mask5, detectfn=2, CL=TRUE)

### D
# null
mLeopardD1 <- secr.fit(cptr_hst, model=list(D~1, g0~session), mask=mask5, detectfn=2, CL=TRUE)
# is density affected by lethal control
mLeopardD2 <- secr.fit(cptr_hst, model=list(D~Control, g0~session), mask=mask5, detectfn=2, CL=TRUE) 

I understood density as being derived and so I was a bit confused by this particular bit of code. If I only have one session, my understanding is that the '###D' objects would firstly not run with the current code, because g0~session would not be applicable, so if I then set g0~1 all my models would come out the same in this case as it is not impacted by anything because g0 won't differ if there is only one session, whereas if you were doing a multi-session survey you might want to explore this?

Many thanks in advance,
Jamie

indu...@gmail.com

unread,
Oct 7, 2022, 9:37:09 AM10/7/22
to secr
Hi Jamie,

Your understanding looks mostly correct to me.

> My understanding is that this just provides me with how that covariate influences detectability at each site and adjusts density estimates accordingly?

Yes to the first part. I wouldn't think of it as adjusting density estimates. Estimates of D will differ with and without the detection covariate but you're not modelling the relationship between density and the detection covariate in any biologically meaningful way. A covariate might have a strong effect on density (say animals are more likely to be at higher elevations) but no effect on detectability (an animal at a distance d from a high-elevation trap is as likely to be seen as an animal at the same distance d from a low-elevation trap). In that case you wouldn't say you've accounted for elevation effects on density by including it as a detection covariate.

> Whereas for modelling influence of covariates on spatial density more widely across the survey area I would need to add the covariates to my mask rather than trap file? In order to add them to the mask and model influence on spatial density however, I need to have data on the covariates for all of the survey area - is that correct?

Yes and yes. You can impute missing values if there are only a few, but you need values across the mask.

> would I be right in saying that my models would not run successfully/be useful if I tried to use this as a covariate in my mask to assess spatial density?

Yes (they would not).

> But would still be able to look at overall density influence of this covariate by including it in the trap file?

No, for the reasons given above.

> I understood density as being derived and so I was a bit confused by this particular bit of code.

You're right, if CL = TRUE then density is not modelled, covariates on D are presumably ignored, and the two models should give the same output. "session" is only applicable to multi-session models. With one session g0 ~ session is conceptually the same as g0 ~ 1. I say conceptually because secr will give an error because session is a factor variable with only one level.

Cheers,
Ian

Jamie McKaughan

unread,
Oct 10, 2022, 4:22:09 AM10/10/22
to secr
Thanks a lot for confirming and clarifying Ian.

So just finally, on that first point.
> My understanding is that this just provides me with how that covariate influences detectability at each site and adjusts density estimates accordingly?
Yes to the first part. I wouldn't think of it as adjusting density estimates. Estimates of D will differ with and without the detection covariate but you're not modelling the relationship between density and the detection covariate in any biologically meaningful way. A covariate might have a strong effect on density (say animals are more likely to be at higher elevations) but no effect on detectability (an animal at a distance d from a high-elevation trap is as likely to be seen as an animal at the same distance d from a low-elevation trap). In that case you wouldn't say you've accounted for elevation effects on density by including it as a detection covariate.
As I understand it, if my model that includes a covariate for 'use of lethal control' estimates density at 2.21 and my null model 2.5 for example, the conclusion is that, given what we know about lethal control in the area, 2.21 is a more likely density estimate. 

Is that the right idea?

Thanks
Jamie

indu...@gmail.com

unread,
Oct 10, 2022, 6:02:23 AM10/10/22
to secr
That's a model selection issue. You'd need to compare the AICs of your candidate models. If it turned out the model with the control covariate was preferred to other models, then yes, you could say that the estimates from that model (like D = 2.21) are the ones that are best supported by your data. Some people prefer to use model averaging in this context, see ?modelAverage.

Ian

Jamie McKaughan

unread,
Oct 10, 2022, 6:43:35 AM10/10/22
to secr
Thanks Ian, that's great. Yes, I should have said assuming the AIC showed a preference.

Great, thanks.

Jamie

Reply all
Reply to author
Forward
0 new messages