How to select the correct link function

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

How to select the correct link function

Postby Hilbert » Mon May 16, 2022 8:57 am

Hi all,

I am currently working on a project where I want to estimate the density of an island population of feral cats. Camera traps were placed on the island and were moved around over a couple of months to cover the whole island.

I am using SECR to obtain my density estimates, and I constructed a simple model with a hazard rate detection function without any problems. I expected density to be influenced by distance to major roads (DTRL), as feral cats may avoid humans.

Code: Select all
covariates(Schiermask)[,"DTRL"] <- distancetotrap(Schiermask, LargeRoadsPoints)

fit.road.HR <- secr.fit (CH, buffer = bufferwidth, detectfn = 'HR', trace = T, mask = Schiermask, D ~ DTRL)


When plotting the mask with distance to roads, everything looks fine, but when running the model I get the following error:

Error in getmaskpar(!CL, D, data$m, sessnum, details$unmash, attr(data$capthist, :
bad densities in 'secrloglikfn' (try different optimisation method, link, or model?

I tried changing the method to Nelder-Mead, but I got the same error message. However, when I started randomly playing around with the link, the model actually fitted.

Code: Select all
fit.road.HR <- secr.fit (CH, buffer = bufferwidth, detectfn = 'HR', trace = T, mask = Schiermask, D ~ DTRL, link = list(D="logit", g0="logit", sigma="log", z ="log"))


While this is nice,I actually have no idea if using this link function makes any sense. Are there data distributions for D, g0, sigma and z? How do I select the right link function?

Any help is greatly appreciated!

Hilbert
Hilbert
 
Posts: 2
Joined: Mon May 16, 2022 5:51 am

Re: How to select the correct link function

Postby murray.efford » Mon May 16, 2022 10:56 pm

Hello Hilbert

I quick solution may be to update to version 4.5.4 (April 2022) in which I changed that message from an error to a warning (I can't remember what prompted that).

The logit link makes sense for probabilities, which must lie between zero and 1. It may by chance work for low density (<< 1/ha), but it's a strange one to use. The usual choice for the density link is between 'log' and 'identity' (identity avoids wild extrapolation outside the sampled area). In general the choice of link is a matter of practicality (applying sensible constraints on the parameter), interpretability (e.g., with respect to effect of covariates) and plausible normality (for Wald confidence intervals). Different links should give the same estimate (more or less) if the model fits.

Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: How to select the correct link function

Postby Hilbert » Wed May 18, 2022 11:08 am

Hello Murray,

Thanks for your quick reply! Updating secr to the latest version did the trick.

Unfortunately, my models have a bit of a strange outcome. Perhaps you could shed some more light on the matter?

As described above, I am trying to see if there are differences in feral cat densities across the island, and I try to explain such differences using covariates like distance to roads. However, when plotting the density surfaces of such models, it appears as if all cats were living near the island borders (beaches and salt marshes) as opposed to the more inland dunes and grasslands. This seems unlikely, as cats were mostly seen at the island interior by us (and thus where we decided to place our camera traps). In fact, telemetry data from a few years back have demonstrated that cats barely make use of the salt marshes and beaches, as opposed to the island interior. Moreover, while practically all of our camera traps were located at the island interior, it was clear that cat sightings decreased around the outer edges of the island.

When checking estimated home range centres using fxi.contour, all home ranges were indeed pressed towards the edges of the island, both for the null models, and models including covariates. Would you have any idea what might cause this? And is there a way to fix this strange behaviour?

Hilbert
Hilbert
 
Posts: 2
Joined: Mon May 16, 2022 5:51 am

Re: How to select the correct link function

Postby murray.efford » Wed May 18, 2022 2:32 pm

Extrapolation of actual density models beyond where you actually sampled is always going to be hazardous. Your model is unconstrained by data around the coast.

Regarding fxi.contour etc. - I've noticed similar effects in several studies. See comment on supposed 'density surfaces' in e.g., https://www.otago.ac.nz/density/pdfs/secr-densitysurfaces.pdf
"The plots are also prone to artefacts. In some examples we see concentric clustering of estimated centres
around the trapping grids, apparently ‘repelled’ from the traps themselves ... This phenomenon appears to relate to lack of model fit (unpubl. results)."

Your data may be a good example of that artifact. The moral is not to take the results from fxi.contour seriously. They are strongly affected by the detection process and its model, as well as the distribution of animals. Misrepresentation (and perhaps misinterpretation) of density patterns is endemic in the Bayesian SECR literature; let's avoid that here.

Murray
murray.efford
 
Posts: 686
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand


Return to analysis help

Who is online

Users browsing this forum: No registered users and 1 guest