Appendix J — Trend revisited

This section describes methods specifically for population trend, defined as change in density between sessions and measured by the finite rate of increase \lambda_t = D_{t+1} / D_t. The flexible methods described here allow the direct estimation of \lambda_t, possibly including covariate effects.

J.1 ‘Dlambda’ parameterization

We parameterize the density model in terms of the initial density D_1 and the finite rates of increase \lambda_t for the remaining sessions (\lambda_1 refers to the density increase between Session 1 and Session 2, etc.). Reparameterization of the density model is achieved internally in secr.fit by manipulating the density design matrix to provide a new array of mask-cell- and session-specific densities at each evaluation of the full likelihood. This happens when the details argument ‘Dlambda’ is set to TRUE. The density model (D~) and the fitted coefficients take on a new meaning determined by the internal function Dfn2. More explanation is given in Section J.4.

Now, fitting the ovenbird model with D~1 results in two density parameters (density in session 1, constant finite rate of increase across remaining sessions):

 msk <- make.mask(traps(ovenCH[[1]]), buffer = 300, nx = 32)
 fit1  <- secr.fit(ovenCH, model = D~1, mask = msk, trace = 
     FALSE, details = list(Dlambda = TRUE))
 coef(fit1)
           beta  SE.beta      lcl       ucl
D.D1   0.032027 0.191324 -0.34296  0.407016
D.D2  -0.063858 0.070151 -0.20135  0.073636
g0    -3.561920 0.150653 -3.85719 -3.266645
sigma  4.363968 0.081052  4.20511  4.522827

Density-relevant beta parameters have names starting with ‘D.’1. The first is the log initial density; others relate to the \lambda parameters.

To make the most of the reparameterization we need the special prediction function predictDlambda to extract the lambda estimates (the simple predict method does not work).

 predictDlambda (fit1)
        estimate SE.estimate     lcl    ucl
D1       1.03254    0.199373 0.70966 1.5023
lambda1  0.93814    0.065893 0.81762 1.0764
lambda2  0.93814    0.065893 0.81762 1.0764
lambda3  0.93814    0.065893 0.81762 1.0764
lambda4  0.93814    0.065893 0.81762 1.0764

This is an advance on the earlier approach using sdif contrasts, as we have constrained \lambda to a constant.

J.2 Covariate and other trend models

The method allows many covariate models for \lambda. We can fit a time trend in \lambda using:

 fit2  <- secr.fit(ovenCH, model = D~Session, mask = msk, 
     trace = FALSE, details = list(Dlambda = TRUE))
 predictDlambda (fit2)
        estimate SE.estimate     lcl    ucl
D1       0.90132    0.212018 0.57192 1.4204
lambda1  1.14737    0.221235 0.78899 1.6685
lambda2  0.99977    0.092474 0.83433 1.1980
lambda3  0.87115    0.085988 0.71826 1.0566
lambda4  0.75908    0.153416 0.51283 1.1236

Session-specific \lambda (lower-case ‘session’) provide a direct comparison with the original analysis:

 fit3  <- secr.fit(ovenCH, model = D~session, mask = msk, 
     trace = FALSE, details = list(Dlambda = TRUE))
 predictDlambda (fit3)
        estimate SE.estimate     lcl    ucl
D1       0.92027     0.22763 0.57080 1.4837
lambda1  1.04689     0.33132 0.57137 1.9182
lambda2  1.18182     0.34965 0.66986 2.0851
lambda3  0.73077     0.22567 0.40447 1.3203
lambda4  0.84210     0.29413 0.43308 1.6374

The ovenbird population appeared to increase in density for two years and then decline for two years, but the effects are far from significant.

Model selection procedures apply as usual:

 AIC(fit1, fit2, fit3)[,-c(2,5,6)]
                      model npar  logLik  dAIC  AICwt
fit1       D~1 g0~1 sigma~1    4 -930.73 0.000 0.5692
fit2 D~Session g0~1 sigma~1    5 -930.07 0.680 0.4051
fit3 D~session g0~1 sigma~1    8 -929.82 6.192 0.0257

Session covariates are readily applied. The covariate for the second session predicts \lambda_1 = D_2/D_1, for the third session predicts \lambda_2 = D_3/D_2, etc. The covariate for the first session is discarded (remember D_1 is constant). This all may be confusing, but you can work it out, and it saves extra coding.

covs <- data.frame(acov = c(0,2,1,1,2))  # fabricated covariate
fit4  <- secr.fit(ovenCH, model = D~acov, mask = msk, 
    trace = FALSE, details = list(Dlambda = TRUE), 
    sessioncov = covs)
 predictDlambda (fit4)
        estimate SE.estimate     lcl    ucl
D1        1.0281     0.21244 0.68858 1.5349
lambda1   0.9501     0.21202 0.61677 1.4636
lambda2   0.9303     0.14528 0.68627 1.2611
lambda3   0.9303     0.14528 0.68627 1.2611
lambda4   0.9501     0.21202 0.61677 1.4636

J.3 Fixing coefficients

Another possibility is to fit the model with fixed trend (the second beta coefficient corresponds to lambda, before).

 fit5 <- secr.fit(ovenCH, model = D~1, mask = msk, trace = FALSE,
    details = list(Dlambda = TRUE, fixedbeta = 
    c(NA, log(0.9), NA, NA)))
 predictDlambda(fit5)
        estimate SE.estimate     lcl    ucl
D1        1.1154     0.15381 0.85231 1.4597
lambda1   0.9000     0.00000 0.90000 0.9000
lambda2   0.9000     0.00000 0.90000 0.9000
lambda3   0.9000     0.00000 0.90000 0.9000
lambda4   0.9000     0.00000 0.90000 0.9000

J.4 Technical notes and tips

Dfn2 performs some tricky manipulations. You can see the code by typing secr:::Dfn2. A column is pre-pended to the density design matrix specifically to model the initial density; this takes the value one in Session 1 and is otherwise zero. Other columns in the design matrix are set to zero for the first session. Session-specific density on the link (log) scale is computed as the cumulative sum across sessions of the initial log density and the modelled log-lambda values.

Note –

  • The model allows detector locations and habitat masks to vary between sessions.

  • The coding of Dfn2 relies on a log link function for density.

  • Dlambda is ignored for single-session data and conditional-likelihood (CL) models.

  • The method is not (yet) suitable for group models.

  • The default start values for D in secr.fit work well: all lambda are initially 1.0 (\mathrm{log}(\lambda_t) = 0 for all t).

  • If session covariates are used in any model, AICcompatible() expects the argument ‘sessioncov’ to be included in all models.

Tip

D for session 1 is constant over space. It is not possible in the present version of secr to model simultaneous spatial variation in density or \lambda, and using Dlambda with a density model that includes spatial covariates will cause an error.


  1. Their indices are listed in component ‘D’ of the ‘parindx’ component of the fitted model (e.g. fit1$parindx$D), but you are unlikely to need this.↩︎