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

I am running multi-year models that span 10 years, with each year being a separate session. I am trying to create models that contain a quadratic trend in g0 and sigma across sessions (years), but I'm having no luck.
To keep it simple I will only talk about models concerning g0 here.

When I run the following model...

MODEL 1:

Density is estimated for each year separately (which is what I want) and g0 is also estimated for every year separately, with a single intercept corresponding to the first year and additional parameters corresponding to each additional year of the study.

When I run the following model...

MODEL 2:

Density is estimated for each year separately (which is what I want) and g0 is estimated as a linear trend across sessions (years), with a single intercept and one additional parameters corresponding to the linear tend in g0.

I am now trying to incorporate a quadratic trend in g0 across sessions (years) but with no luck. When I run the follow 2 models, with or without parenthesis around Session...

MODEL 3:

MODEL 4:

...the program simply ignores the squared term and instead estimates a linear trend in g0 across sessions (year) exactly like MODEL 2 above.

When I run the follow 2 models, with or without parenthesis around session...

MODEL 5:

MODEL 6:

...the program again ignores the squared term and instead estimates a separate g0 for each separate year exactly like MODEL 1 above.

So how do I correctly incorporate a quadratic trend in g0 across sessions (years)?

Thanks

Posts: 16
Joined: Tue Mar 03, 2015 2:11 pm

### Re: Quadratic Trend on Session

'secr' does not directly allow polynomial terms in the model formula (except for density D via the 'canned' predictors x2 and y2). However, you can easily construct the quadratic using a session-level covariate.
Code: Select all
scov <-  data.frame(Sess = 1:5, Sess2 = (1:5)^2)
fit <- secr.fit(ovenCH, buffer=300, model = g0~Sess + Sess2, sessioncov = scov)

Note that sessioncov is a dataframe with one row for each session, and the quadratic is on the link scale (default logit for g0). You could use the builtin Session instead of Sess for the linear term, but it's convenient to just re-use scov for prediction:
Code: Select all
predict(fit, newdata = scov)
# plot to confirm
plot(sapply(predict(fit, newdata = scov), '[', 'g0','estimate'))

Murray
murray.efford

Posts: 547
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand