Long page
descriptions

Chapter 4   Time Series

4.1   Time series plots

4.1.1   Time series plots

A time series plot is similar to a scatterplot with 'time' as the variable on the horizontal axis. Successive values are usually joined by lines to emphasise systematic movements in the series.

4.1.2   Patterns in time series

A few examples show time series with trend, seasonal pattern and other oscillations.

4.1.3   Multiple time series

An example shows four different time series on the same graph.

4.2   Smoothing

4.2.1   Moving averages

Moving averages are a simple way to smooth out irregularities in a time series.

4.2.2   More about moving averages

When an even number of values is used for the moving averages, the smoothed values are at times half-way between those of the raw data. The method can be modified to give smoothed values at the times of the original values.

4.2.3   Robust smoothing ((optional))

Using running medians instead of means avoids the effect of outliers, but the result often looks 'stepped'. The use of running medians, followed by running means, is a good compromise.

4.2.4   Exponential smoothing

Exponential smoothing replaces each value with a weighted average of it and previous values. Unlike moving averages, it can be used right up to the end of the series.

4.2.5   Lowess smoothing of time series ((advanced))

An alternative smoothing method that provides smoothed values to both ends of a time series is to obtain the smoothed value from a least squares line fitted to adjacent values.

4.2.6   Lowess smoothing of scatterplots ((advanced))

A similar method can be used to draw a 'smooth' curve to represent a nonlinear relationship on a scatterplot.

4.3   Long-term trend

4.3.1   Linear trend

Many time series steadily increase or decrease over time and a linear model may describe the trend. This kind of model can be fitted by least squares.

4.3.2   Quadratic trend

If the trend is nonlinear, a quadratic model might describe the trend better and can also be fitted by least squares.

4.3.3   Forecasting

Linear and quadratic models can be used to forecast future values.

4.3.4   Polynomial trend

If a quadratic model does not adequately describe a nonlinear trend, it is possible to add higher powers of time to the model. These polynomial models may give a smooth picture of past trend but should not be used to forecast into the future.

4.3.5   Detrending a time series

Polynomial models are only useful to describe a smooth long-term trend in a time series. A time series plot of least squares residuals (actual values minus trend) highlights shorter-term movements in the series.

4.4   Short-term fluctuations

4.4.1   Autocorrelation

Even after removal of trend, successive values in a time series are often correlated -- values above the trend are often followed by others above it and, similarly, values below the trend often occur together.

4.4.2   AR(1) model for autocorrelation

The similarity of successive values in a time series (or detrended time series) can be modelled by a linear model that forecasts each value (or detrended value) as a linear function of the previous one.

4.4.3   AR(1) model and trend

The trend should be removed before fitting an autoregressive model then added back to forecast future values.

4.4.4   Trend or autocorrelation?

A simple mechanism of autocorrelation of successive residuals can give the impression of trend when none is present in the underlying process.

4.4.5   Cyclical patterns

Some time series vary in regular or irregular cycles. Irregular cycles can be modelled and forecast using the methods of this section but regular cycles (seasonal patterns) should be forecast with different methods.

4.5   Seasonal data

4.5.1   Seasonal patterns

Seasonal data may show a pattern that repeats at regular intervals.

4.5.2   Smoothing out seasonal variation

Moving averages with order equal to the number of seasons can smooth out seasonal variation.

4.5.3   Estimating the seasonal effect

The average difference between the data and the corresponding smoothed values in any month is called the seasonal effect for that month.

4.5.4   Deseasonalised data

Subtracting the seasonal effect from the raw data is called seasonally adjusting the data and the resulting values are called deseasonalised.

4.5.5   Putting it all together

Seasonal data can be split into four components -- seasonal, trend, cyclical and residual.

4.5.6   Forecasting with seasonal data

The seasonal, trend and cyclical components of a time series can each be forecast into the future. Adding them provides a forecast for future values.

4.6   Multiplicative models

4.6.1   Additive and multiplicative models

In some time series, the different components affect the data multiplicatively rather than additively. If the data are replaced by their logs, a multiplicative model becomes additive.

4.6.2   Properties of multiplicative models

In a multiplicative model, the seasonal pattern has greater amplitude when the trend is higher.

4.6.3   Forecasting with multiplicative models

A multiplicative model is fitted by using an additive model with the log data. The resulting forecasts are also of the log data, and so must be back-transformed to give a forecast in the original units.

4.6.4   Analysing the right data

Many types of data should be modified before attempting to interpret them in a time series plot. Seasonal adjustment, transforming to constant dollars and use of per capita data are examples.

4.6.5   Types of time series data

Time series can describe processes that are discrete or continuous, and the measurements of continuous processes can be aggregates or snap-shots. The values can also be either discrete or continuous.

4.7   Index numbers

4.7.1   Introduction

Index numbers are widely used in business and industry to measure the changes of one or more related quantities over time.

4.7.2   Simple price index

A simple price index measures the price of a single item or commodity as a percentage of its price at a base time.

4.7.3   Aggregate price index

An aggregate price index combines the prices of several related items into a single index number.

4.7.4   Laspeyres and Paasche indices

These indices allow aggregate price indices to give differing weights to the items that make up the index.

4.7.5   Deflating a time series

The effect of a quantity such as inflation can be removed from a time series by deflating it.