#### Time-varying parameters in ecological models

Ecological models approximate complicated biological and sampling processes with simple equations and functional forms. However, the parameters that are used to approximate these processes will often vary over time. The process errors induced by these types of variability will often lead to qualitative differences in the predictions of ecological models (Clark 2003), and accounting for this variability remains a central challenge for ecological modelling.

The stepwise-spline approximation that we propose represents a family of time-varying forms: assuming a parameter is constant over time, estimating a smoothed form for a time-varying parameter, or estimating annually varying parameters. Similarly, a piecewise-constant (e.g. 0th-order spline) is equivalent to estimating a separate value for different blocks of time, as has been proposed for some time-varying parameters in fishery population dynamics models (Legault 2008). We show that model selection tools that are commonly used by ecologists can identify an appropriate degree of smoothness (at the same time as other model selection decisions). We additionally propose that AIC-selection of a model with time variability in a parameter indicates that the process represented by this parameter is likely to be changing over time. We note that the sensitivity and specificity of the stepwise approximation when identifying the presence or absence of time-varying processes requires additional testing. However, in cases where failing the account for time-varying processes is very risky (such as time-varying abundance for managed marine species), we believe that this method for identifying time variability is appropriate.

The spline approximation presented here requires several subjective decisions within any given study. B-splines (Hastie, Tibshirani & Friedman 2009) will be appropriate in cases where rapid convergence is necessary, because each spline component has local support and low covariance with other coefficients. By contrast, the parameters of the splines that we use will exhibit high covariance, but will allow logical bounds (or likelihood penalties) to be placed on estimated coefficients. Additionally, the order of the spline (e.g., piecewise-constant, piecewise-linear, piecewise-quadratic, etc.) must be chosen. This could in theory be selected using AIC or cross-validation, although the authors know of no study that has explored this, and many packages assume a cubic-spline (e.g., Wood 2006) by default. Researchers must also choose a criterion for selecting an appropriate number of knots, which could include AIC, the low sample size bias adjustment for AIC (AIC_{c}), the Schwarz Bayesian Information Criterion (BIC Schwarz 1978), generalized cross-validation (Wood 2006) or many others. We have used AIC for simplicity, but future research could explore the appropriate degree of penalty for selecting spline degrees of freedom in different applications. Future research could also evaluate spline models that select among many possible breakpoints instead of the evenly spaced knots used here. Breakpoint techniques such as this are conceptually simple, but would significantly decrease the speed of any model selection algorithm. Selection of the location of knots would presumably improve model performance when parameters change more rapidly at some times than others and is an important topic of future research.

Population dynamics studies will frequently select between the constant and annually varying form for parameters using the AIC (e.g., Cubaynes *et al*. 2011; Monk, Berkson & Rivalan 2011; Marescot *et al*. 2011), perhaps due to the ease with which a parameter can be specified as constant or annually varying within common software such as m-surge for capture–mark–recapture (Choquet *et al*. 2004) and ‘unmarked’ for occupancy modelling (Fiske & Chandler 2011). We propose that easy symbolic notation for the spline approximation, such as that used in the ‘mgcv’ package for generalized additive models (Wood 2006), would ease the incorporation of the spline approximation into applied studies if included in common software for population dynamics models.

In addition to the spline approximation presented here, time-varying processes can be treated as random effects or penalized coefficients. However, both of these methods have drawbacks and will not be feasible or appropriate for all modelling situations. Random effect estimation requires integration and is computationally demanding (de Valpine 2009). In our case, we compared a basic implementation of a random-effect model with the stepwise-spline approximation. We used the admb-re software to evaluate the necessary multivariate integral, which required some familiarity with the ‘partial separability’ of state-space random-effect coefficients (Skaug & Fournier 2006) to develop a parameterization that was computationally feasible, relatively fast and numerically stable. However, this random-effect model did not improve estimation performance, likely because time variability in our simulation experiment was highly autocorrelated and hence was more easily approximated using the spline method than random effect deviations. Alternatively, a time-varying parameter can be approximated using a smoothing spline (or variations thereon) with multiple fixed effects and specifying a penalty to constrain changes to be small or gradual, where the penalty itself is estimated using simple or generalized cross-validation (Wood 2006; Maunder & Harley 2011). However, simple cross-validation will frequently require numerous cycles of optimization to evaluate the fit for each model (e.g. 10 for 10-fold cross-validation), which may be prohibitive for large and complicated models. By contrast, generalized cross-validation is faster but requires estimating the effective degrees of freedom for a smoothed parameter (Meyer & Woodroofe 2000). This estimation is likely possible for many ecological models, but requires resolving several issues specific to the occupancy models presented here, that is, their hierarchical design and discrete-valued predictions. We therefore suggest that developing generalized cross-validation methods for occupancy models is an important area of future research.

#### Occupancy models

Occupancy models have been a hot research topic for at least a decade (MacKenzie *et al*. 2005) and can simultaneously estimate detectability and abundance using survey data (Royle & Nichols 2003). Occupancy models have been modified to account for false-positive detections (Royle & Link 2006), finite-population corrections (Royle & Kéry 2007), spatially varying detection probabilities (MacKenzie *et al*. 2002) and aggregation behaviours for target individuals (Zhou & Griffiths 2007). An occupancy model was chosen to demonstrate the stepwise-spline approximation to time-varying parameters because occupancy models are informative about both abundance and detectability, and hence time variability in one is unlikely to be confounded with the other. Detectability is one of the most difficult-to-estimate parameters in marine stock assessment modelling and is frequently confounded with other biological processes (Zhou *et al*. 2011), so the capacity to estimate it using survey data is a powerful reasons for applying occupancy modelling.

Occupancy models involve several strong assumptions, including locally closed populations, independent detection of individuals, and no missing variables related to detectability (MacKenzie *et al*. 2005). However, these models may still be preferable to implicit, but strong assumptions about spatially constant detectability, even in cases where occupancy model assumptions are violated or impossible to verify (Mazerolle *et al*. 2007). We have demonstrated that estimates of the proportion of abundance in a given spatial stratum are only mildly biased even when local detectability is distributed according to a beta-binomial model, thus responding to concerns raised by Martin *et al*. (2011). Marescot *et al*. (2011) similarly demonstrated robust results when using a different ratio of estimates, that is, the change in abundance over time. We hope that further research will continue to identify which model estimates (or derived quantities) are sensitive or robust to violations of occupancy model assumptions.

We propose that increased parsimony regarding time-varying parameters will increase the accuracy and interpretability of future occupancy model applications as well as for other common ecological models. However, future applications of the stepwise-spline approximation to time-varying parameters may require additional diagnostics related to confounded parameters (e.g. inspection of the estimated correlation among parameters) when used with models that cannot separately estimate parameters. The consequences of estimating time-varying parameters in models that are highly confounded are an important topic for future research.