0% found this document useful (0 votes)
121 views4 pages

Ecological Time Series Modeling Techniques

This document discusses different methods for modeling ecological time series data: 1) Process error estimation assumes all errors are due to model mis-specification and ignores observation errors. 2) Observation error estimation assumes a known ecological process but imperfect observations, treating all differences as observation errors. 3) Kalman filtering accounts for both process and observation errors by iteratively predicting values and updating predictions based on new observations. It requires estimating observation error covariance and is best for linear models.

Uploaded by

michel mboue
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views4 pages

Ecological Time Series Modeling Techniques

This document discusses different methods for modeling ecological time series data: 1) Process error estimation assumes all errors are due to model mis-specification and ignores observation errors. 2) Observation error estimation assumes a known ecological process but imperfect observations, treating all differences as observation errors. 3) Kalman filtering accounts for both process and observation errors by iteratively predicting values and updating predictions based on new observations. It requires estimating observation error covariance and is best for linear models.

Uploaded by

michel mboue
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

Models for Ecological Time Series


Steve Carpenter, Zoology 535

Models for changes in ecological variables over time require some additional analytical
tools, beyond those we have used so far. Generally, such models relate values at a particular
time to values at a previous time. For example, many ecological models have the general form

y t = f ( y t −1 , x t , θ ) + ε t [1]

where y is an ecological time series, x represents covariates, θ represents parameters, and ε is a


time series of residuals or errors. The time series can be a vector, and there can be multiple
parameters. Covariates are optional, and there can be any number of covariates. The function f
can be linear or nonlinear.

Equation 1 is called a process equation, or transition equation, and the residuals ε are
called "process errors". They represent errors due to using the wrong process (f) to explain how
nature generated the observations.

Statistical time series analysis emphasizes the removal of autocorrelation from the time
series y. This can be important for ecological time series. However, most ecological time series
are too short for detailed analysis of autocorrelation. Also, the ecological research question is
usually "what model for the ecosystem (represented by f) seems most consistent with the data"?
Thus ecologists usually want to examine several models and compare their fit to the data using
some statistic such as AIC. This analysis may or may not involve removal of autocorrelation,
depending on the details of the particular case.

Schematic diagram: Ecological inference


Nature Scientist

Evaluate ideas about the


True but Unknown ?? ecosystem by comparing
Ecosystem Process models (f) that represent
contrasting ideas.

Fit various models (for both


process and observation)
estimate parameters,
evaluate lack of fit

True but Observe


Unknown Time series y
Time series μ (and perhaps
covariates x)
2

Observation error, or measurement error in the y's, must often be considered when
modeling ecological time series (see figure on preceding page). This calls for another equation,
the observation equation, which relates y to a true but unknown value μ and observation errors υ:

yt = μ t + ν t [2]

Often it is possible to estimate μ and υ using replicate samples at each point in time.

There are many ways to address the problem of fitting equations 1 and 2 to data. We will
cover three of the most common options: process error estimation, observation error estimation,
and Kalman filter estimation.

Process Error Estimation

If measurements show that observation errors are small, it may be OK to ignore them and fit
equation 1 as if observation errors can be ignored. Sometimes this procedure is called "pure
process error fitting" because it assumes that all the error (or almost all of it) is due to mis-
specification of the true ecological process. The pseudocode is as follows:

1. Using initial guesses of the parameters θ, calculate each estimated value of y using the
previous observed value of y:

yˆ t = f ( yt −1 , xt ,θ )

2. Calculate process error

ε t = yt − yˆ t

3. Calculate the lack-of-fit statistic (sum of squared errors, negative log likelihood, etc.) and find
the parameters that minimize it, using an interative optimization program on the computer (e.g.
the function 'nlm' in R, or 'fminsearch' in Matlab).

Observation Error Estimation

If observation errors are thought to be large, it may be best to assume that all the error is
observation error. This procedure is sometimes called "pure observation error fitting" because it
proceeds as if the true ecological process is known, but the observations are imperfect. The
pseudocode is as follows:

1. Set the initial estimated value of y equal to the first observation:

yˆ1 = y1

2. Using initial guesses of the parameters θ, calculate each estimated value of y using the
previous estimated value of y (not the previous observed value of y as in process-error fitting):
3

yˆ t = f ( yˆ t −1 , xt ,θ )

3. Calculate errors

ε t = yt − yˆ t

4. Calculate the lack-of-fit statistic (sum of squared errors, negative log likelihood, etc.) and find
the parameters that minimize it, using an interative optimization program on the computer (e.g.
the function 'nlm' in R, or 'fminsearch' in Matlab).

Kalman Filter Estimation

If the observation errors can be estimated (e.g. from replicates), it is possible to account for both
observation and process error using an algorithm called the Kalman Filter.

If the function f is nonlinear in parameters (i.e. df/dθ is a function of one or more parameters),
then the usual Kalman Filter will not work. There is an alternative called the Extended Kalman
Filter (EKF). However, most ecological time series are not long enough to yield good results
with the EKF.

If the function f is linear in parameters (i.e. df/dθ is not a function of any parameter) then the
usual Kalman Filter often performs well.

First rewrite the process equation as

αt = B αt-1 + C ut + εt

where bolding indicates quantities that can be vectors or matrices. Here α is the true but
unknown value of y, B is the parameters that connect y over time, u is the covariates x, and C is
the parameters for the effects of the covariates. As before, ε represents process error, which is
distributed multivariate normal with mean 0 and covariance matrix Q.

ε ~ N(0, Q)

The observation equation is

yt = αt + υt, υ ~ N(0, H)

The problem solved by the Kalman Filter is this: given measurements of y and the observation
covariance matrix H, estimate B, C and Q.

The pseudocode is as follows.

1. Guess initial values for B, C and Q.


4

2. Set the initial estimator of α, a1, equal to the first observed y: a1 = y1.

3. Set the process covariance for the first time step, P1, equal to Q.

4. Starting with time step 2, build time series of a and P by iterating through the following
sequence of calculations for each time step:

4a. Predict next a and P based on information in preceding time steps:

at|t-1 = B at-1 + C ut

Pt|t-1 = B Pt-1 B’ + Q

4b. Update the predictions by correcting for the information in the new observation made
at the time step:

vt = yt – at|t-1

Ft = Pt|t-1 + Ht

at = at|t-1 + Pt|t-1 Ft-1 vt

Pt = Pt|t-1 – Pt|t-1 Ft-1 Pt|t-1

5. For a single time step, the negative log likelihood is

-log(Lt) = 0.5 N log(2π) + 0.5 log (det (Ft) ) + 0.5 vt’ Ft-1 vt

These terms are summed up over all the time steps to calculate the overall negative log
likelihood.

6. Find the values of B, C and Q that minimize the negative log likelihood, using an interative
optimization program on the computer (e.g. the function 'nlm' in R, or 'fminsearch' in Matlab).

References

Harvey, A.C., 1989, Forecasting, Structural Time Series Models, and the Kalman Filter.
Cambridge University Press.

Hilborn, R. and M. Mangel. 1997. The Ecological Detective – Confronting Models with Data.
Princeton Univ. Press, N.J.

You might also like