Agricultural Statistics & Data Science · Time series, forecasting and modelling · also Time Series Analysis and Forecasting, Advanced Time Series (PhD)
Modelling observations ordered in time, from classical decomposition to Box-Jenkins and beyond: stationarity, ARIMA and seasonal ARIMA, volatility models for prices, vector autoregressions, state-space models and the Kalman filter, and forecast evaluation. Agribusiness econometrics introduces ARIMA and unit roots; this subject is the full treatment.
In the exams: AICE-JRF Ag Stat Unit 2 'components of time series' (present); UPSC ISS Statistics III/IV (heavy, reported); RBI Grade B DSIM (heavy, reported); PhD course in most programmes
A time series is a set of observations taken in order over time: monthly wholesale prices of onion in a market yard, weekly arrivals of milk at a dairy plant, annual rice yield of a district, daily rainfall at a weather station. What sets these data apart from the samples of earlier statistics courses is that neighbouring observations are not independent. This month's price carries information about next month's, and a model that ignores the dependence gives wrong standard errors, wrong tests and poor forecasts. Time series analysis is the set of methods that describe, model and forecast such dependent data.
The subject runs from the classical decomposition into trend, seasonal, cyclical and irregular parts, through exponential smoothing, to the Box-Jenkins ARIMA approach and its seasonal and regression extensions. It then covers the tools of modern econometrics that agricultural economists and statisticians use every week: unit-root tests and structural breaks, ARCH and GARCH models for price volatility, vector autoregressions and cointegration for linked markets, state-space models with the Kalman filter, an introduction to spectral analysis, and the evaluation of forecasts with MAPE, RMSE and the Diebold-Mariano test.
Examinations treat the subject at three depths. Entrance and junior-officer papers ask about components of a time series, moving averages and seasonal indices. Master's and PhD entrance papers in agricultural statistics, and civil-service statistics papers such as the Indian Statistical Service and central-bank statistical officer examinations, ask about stationarity, autocorrelation functions, ARIMA identification, unit roots and cointegration. PhD courses and professional practice add volatility models, state-space methods and formal forecast comparison. The regression theory this subject relies on is treated in the Linear Models and Regression subject of this track; the survey data that most agricultural series come from are treated in Crop Estimation Surveys; and the use of these methods to forecast harvests is the subject of Crop Forecasting and Growth Models.
Classical analysis views an observed series Y(t) as the result of four movements. The trend (T) is the long-run direction, such as the steady rise in wheat yield that followed new varieties and irrigation. The seasonal component (S) is a pattern that repeats within a fixed period of one year or less: vegetable prices fall after harvest every winter and rise in the lean months; milk procurement rises in the flush season. The cyclical component (C) is an oscillation longer than a year with no fixed period, such as the hog cycle in livestock prices or business cycles in farm incomes. The irregular or random component (I) is what remains: weather shocks, strikes, a pest outbreak. Seasonal and cyclical movements differ in that seasonality has a known, fixed period and cycles do not. With monthly data the seasonal period is 12, with quarterly data 4, and with weekly data 52 (strictly about 52.18 weeks per year, which is why weekly seasonality is awkward).
In the additive model Y = T + S + C + I, the components are in the units of the data, and the seasonal effect is a fixed amount, for example 300 rupees per quintal above trend in July, whatever the level. In the multiplicative model Y = T x S x C x I, the trend is in data units and the other components are ratios or indices, so the seasonal swing grows with the level: July is 12 per cent above trend. The multiplicative model suits most economic series, where seasonal amplitude rises as prices or production grow; a plot of the series in which the seasonal peaks widen as the level rises is the usual sign. Taking logarithms converts a multiplicative model into an additive one, which is why log transformation is so common before modelling prices. Mixed forms such as Y = T x S + I are also used.
Trend can be measured freehand (a graph and judgement), by semi-averages (split the series into two halves and join the two averages), by moving averages, or by fitting a mathematical curve by least squares. A linear trend Y = a + bt is fitted by ordinary least squares with time coded as t = 1, 2, ... or as deviations from the middle year, which makes the sum of t zero and gives a = mean of Y and b = sum(tY)/sum(t squared). Quadratic trends, exponential trends (fitted as log Y = a + bt, so that b estimates the compound growth rate once converted, growth rate = antilog(b) - 1), and growth curves such as the modified exponential, Gompertz and logistic are used when the pattern bends. The exponential trend is the standard way agricultural economists compute compound annual growth rates of area, production and yield. Curve-fitting trends rest on regression ideas covered in Linear Models and Regression; note that ordinary least-squares standard errors are not reliable when residuals are autocorrelated, which they usually are in time series.
The ratio-to-moving-average method is the standard classical way to measure seasonality in a multiplicative series. Step 1: compute a centred moving average of order equal to the period. For monthly data a 12-month average falls between months, so a 2 x 12 moving average (a 12-month average followed by a 2-term average of adjacent values) is used to centre it; this centred average contains T x C and has removed S and most of I. Step 2: divide each observation by its centred moving average and multiply by 100, giving S x I as a percentage. Step 3: for each month, average these ratios across years (a median or a modified mean that drops extremes reduces the influence of I). Step 4: adjust the averages so they total 1200 for monthly data (400 for quarterly), that is, so the mean index is 100. The seasonally adjusted (deseasonalised) series is then Y divided by S, times 100. Other classical methods are simple averages (crude, as it ignores trend), ratio to trend, and the link-relative method. Modern statistical offices use X-13ARIMA-SEATS, developed from the US Census Bureau's X-11 family, or STL (seasonal-trend decomposition using loess), which handle trading-day effects, moving holidays and outliers.
A simple moving average of order m replaces each value by the mean of m consecutive values. An odd order, such as 3 or 5, is centred on an observation; an even order, such as 4 or 12, falls between observations and must be centred by a further 2-term average. A moving average whose order equals the seasonal period removes a fixed seasonal pattern completely, and it removes a linear trend without distortion, which is why the 2 x 12 average is the building block of classical decomposition. Moving averages have drawbacks: values are lost at both ends of the series (m/2 at each end for a centred average), they flatten peaks and troughs, and an average of the wrong length can create spurious cycles out of random noise, the Slutsky-Yule effect. Weighted moving averages, such as Spencer's 15-point formula and the Henderson filters used in X-11, give smoother trends that follow curvature better.
Simple exponential smoothing (SES) forecasts a series with no trend or seasonality by a weighted average of past observations whose weights decline geometrically. With smoothing constant alpha between 0 and 1, the level is updated as L(t) = alpha Y(t) + (1 - alpha) L(t-1), and the forecast for every future period is the current level, a flat line. Expanding the recursion shows that the weight on Y(t-j) is alpha(1 - alpha) to the power j. A large alpha (close to 1) reacts quickly and follows the latest observation; a small alpha smooths heavily and reacts slowly. The equivalent error-correction form is L(t) = L(t-1) + alpha e(t), where e(t) is the one-step forecast error. SES gives optimal forecasts when the series is an ARIMA(0,1,1) process, that is, a random walk observed with noise. In practice alpha and the starting level are chosen by minimising the sum of squared one-step-ahead errors.
Holt's linear method adds a trend. The level is L(t) = alpha Y(t) + (1 - alpha)(L(t-1) + b(t-1)), the slope is b(t) = beta (L(t) - L(t-1)) + (1 - beta) b(t-1), and the h-step forecast is L(t) + h b(t). A damped-trend version multiplies the slope by a factor phi below 1 at each step, so long-range forecasts level off; damped trends often forecast better than straight lines in practice. The Holt-Winters method adds a seasonal equation with its own constant gamma. In the additive version the seasonal terms are added to the level and trend; in the multiplicative version the forecast is (L + h b) times the seasonal factor for the target season. As with decomposition, the multiplicative form is chosen when seasonal swings grow with the level. Holt-Winters forecasting of monthly milk procurement, cold-store arrivals or fertiliser sales is a common first model in agribusiness because it is simple, automatic and explains itself to managers.
For a long time exponential smoothing was seen as a heuristic. The innovations state-space framework (often called ETS, for error, trend and seasonal) showed that each smoothing method corresponds to a statistical model with a single source of error, so that parameters can be estimated by maximum likelihood, models compared by information criteria such as AIC, and prediction intervals computed properly. There are additive- and multiplicative-error versions of each method; they give the same point forecasts but different intervals. Linear exponential smoothing models are special cases of ARIMA models, but multiplicative-error and multiplicative-seasonal models have no ARIMA equivalent, and many ARIMA models have no smoothing equivalent. In forecasting competitions, simple combinations of exponential smoothing methods have been hard to beat for short, noisy business series, a useful caution before choosing a complicated model.
A process is strictly stationary if the joint distribution of any set of observations is unchanged by a shift in time. It is weakly (covariance or second-order) stationary if its mean is constant, its variance is finite and constant, and the covariance between Y(t) and Y(t+k) depends only on the lag k, not on t. Most of time-series modelling assumes weak stationarity, because only then do quantities such as the autocorrelation at lag 3 have a single meaning that can be estimated by averaging over time. A series with trend has a changing mean; a series whose spread grows with its level has a changing variance; a random walk has a variance that grows with time. Non-stationarity in the mean is removed by differencing (or by removing a deterministic trend, if the trend is deterministic); non-stationarity in variance by a log or Box-Cox transformation. White noise, a sequence of uncorrelated variables with mean zero and constant variance, is the simplest stationary process and the building block of all linear models.
The autocovariance at lag k is gamma(k) = Cov(Y(t), Y(t+k)), and the autocorrelation is rho(k) = gamma(k)/gamma(0); rho(0) = 1, rho(k) = rho(-k), and |rho(k)| is at most 1. The sample autocorrelation r(k) is the sum over t of (Y(t) - Ybar)(Y(t+k) - Ybar) divided by the sum of (Y(t) - Ybar) squared, using all n observations in the denominator. A plot of r(k) against k is the correlogram. For white noise, r(k) for k of at least 1 is approximately normal with mean zero and variance 1/n, so values outside plus or minus 1.96 divided by the square root of n are significant at about 5 per cent; Bartlett's formula gives wider bands for higher lags when lower-lag autocorrelations are non-zero. Reading the correlogram: a slow, almost linear decay from a high value signals non-stationarity (difference the series); spikes at lags 12, 24, 36 in monthly data signal seasonality; a sharp cut-off after lag q suggests a moving-average component of order q.
The partial autocorrelation at lag k, written phi(k,k), is the correlation between Y(t) and Y(t+k) after removing the linear effect of the intermediate values Y(t+1), ..., Y(t+k-1). Equivalently it is the last coefficient when Y(t) is regressed on its first k lags. It is computed from the autocorrelations by the Durbin-Levinson recursion; at lag 1 it equals rho(1), and at lag 2 it is (rho(2) - rho(1) squared)/(1 - rho(1) squared). For an autoregressive process of order p the partial autocorrelations are zero beyond lag p, so the PACF cuts off; for a moving-average process the PACF decays. Under white noise the sample partial autocorrelations also have approximate standard error 1 over the square root of n. The ACF and PACF together are the main identification tools of the Box-Jenkins approach.
Rather than test each autocorrelation separately, portmanteau tests combine the first h of them. The Box-Pierce statistic is Q = n times the sum of r(k) squared for k = 1 to h. The Ljung-Box statistic, Q* = n(n + 2) times the sum of r(k) squared divided by (n - k), has a distribution closer to chi-square in moderate samples and is the one normally used. For a raw series, Q is compared with chi-square on h degrees of freedom; when applied to residuals of a fitted ARMA(p, q) model, the degrees of freedom are h - p - q. A large Q rejects the hypothesis that the series (or the residuals) is white noise. The choice of h matters: too small misses seasonal correlations, too large loses power; values around 10 for non-seasonal data and two seasonal periods for seasonal data are common choices, and the test is reported at more than one h.
An autoregressive process of order p, AR(p), writes the current value as a linear combination of its own past values plus white noise: Y(t) = c + phi1 Y(t-1) + ... + phip Y(t-p) + e(t). With the backshift operator B (B Y(t) = Y(t-1)) this is phi(B) Y(t) = c + e(t), where phi(B) = 1 - phi1 B - ... - phip B to the power p. The process is stationary when all roots of phi(z) = 0 lie outside the unit circle. For AR(1) this means |phi1| < 1; the mean is c/(1 - phi1), the variance is sigma squared/(1 - phi1 squared) and the autocorrelations are rho(k) = phi1 to the power k, decaying geometrically (alternating in sign if phi1 is negative). For AR(2), stationarity requires phi1 + phi2 < 1, phi2 - phi1 < 1 and |phi2| < 1; complex roots give a damped sine-wave ACF, the classical signature of a pseudo-cycle, such as a cattle or pig cycle. AR(1) with phi1 = 1 is the random walk, which is not stationary.
A moving-average process of order q, MA(q), writes Y(t) as a combination of current and past shocks: Y(t) = mu + e(t) + theta1 e(t-1) + ... + thetaq e(t-q). (Some texts, including Box and Jenkins, write the thetas with minus signs; always check the convention before using a formula.) An MA process of finite order is always stationary. Its autocorrelations are zero beyond lag q, the cut-off that identifies it. For MA(1) with the plus-sign convention, rho(1) = theta/(1 + theta squared), so |rho(1)| can never exceed 0.5. The same rho(1) is produced by theta and by 1/theta, so a condition is needed to pick one: invertibility, which requires the roots of theta(z) = 0 to lie outside the unit circle (|theta| < 1 for MA(1)). An invertible MA process can be written as an AR process of infinite order, which is why its PACF decays rather than cutting off.
Combining the two gives ARMA(p, q): phi(B) Y(t) = c + theta(B) e(t). It is stationary if the AR roots lie outside the unit circle and invertible if the MA roots do, and the two polynomials should share no common root (otherwise the model is over-parameterised and the common factor cancels). Both the ACF and PACF of an ARMA process decay rather than cut off, which makes the orders harder to read from a correlogram; information criteria and the extended ACF help. Wold's decomposition theorem gives the theoretical basis: every weakly stationary, purely non-deterministic process can be written as an infinite moving average of white-noise shocks with square-summable weights. ARMA models are parsimonious rational approximations to that infinite moving average, which is why low orders, rarely beyond p + q = 3 for non-seasonal agricultural series, usually suffice.
Multiplying the AR(p) equation by Y(t-k) and taking expectations gives the Yule-Walker equations, rho(k) = phi1 rho(k-1) + ... + phip rho(k-p) for k of at least 1. They link the autoregressive coefficients to the autocorrelations and give method-of-moments estimates. For AR(1), phi1 = rho(1). For AR(2), solving the first two equations gives phi1 = rho1(1 - rho2)/(1 - rho1 squared) and phi2 = (rho2 - rho1 squared)/(1 - rho1 squared); note that phi2 equals the lag-2 partial autocorrelation. The white-noise variance follows from sigma squared = gamma(0)(1 - phi1 rho1 - ... - phip rhop). Yule-Walker estimates are quick and always give a stationary model, but they can be inefficient when roots are near the unit circle; maximum likelihood is preferred for final estimates.
Many agricultural series, such as prices, production and stocks, wander without a fixed mean. If the d-th difference of a series is a stationary ARMA(p, q) process, the series is integrated of order d, I(d), and follows an ARIMA(p, d, q) model: phi(B)(1 - B) to the power d Y(t) = c + theta(B) e(t). The random walk is ARIMA(0,1,0); the random walk with drift adds a constant, so that forecasts rise linearly. Most economic series need d = 1, occasionally d = 2; over-differencing is a common error and shows itself in a lag-1 autocorrelation of the differenced series near -0.5 and an MA coefficient near -1 (a non-invertible root). The constant matters once differencing is involved: with d = 1 a non-zero constant implies a linear trend in the level forecasts; with d = 2 it implies a quadratic trend, which is rarely sensible.
Box and Jenkins proposed an iterative three-stage cycle: identification, estimation and diagnostic checking, followed by forecasting. In identification, the analyst first stabilises the variance (log or Box-Cox), then chooses d by looking at the time plot and ACF and by unit-root tests (Chapter 7), and then reads tentative p and q from the ACF and PACF of the stationary series. The rules of thumb: ACF cuts off after lag q and PACF decays gives MA(q); PACF cuts off after lag p and ACF decays gives AR(p); both decay gives a mixed ARMA, whose orders are better chosen by comparing a few candidate models. Information criteria make the comparison formal: AIC = -2 log L + 2k and BIC (Schwarz) = -2 log L + k log n, where k is the number of estimated parameters; the smaller is better. BIC penalises extra parameters more heavily and tends to pick smaller models; AIC tends to pick models that forecast well. Criteria can only compare models fitted to the same differenced data.
Parameters are estimated by conditional least squares (minimising the sum of squared residuals given starting values), by unconditional least squares, or by exact maximum likelihood under a normal assumption, computed with the Kalman filter in modern software. For pure AR models, least squares is ordinary regression on lagged values. For models with MA terms, the residuals are non-linear functions of the parameters and iterative methods (Gauss-Newton, Marquardt) are used. Estimates should be checked for stationarity and invertibility, for significance (estimate divided by its standard error, compared with roughly 2), and for high correlation between estimates, which signals redundancy, for example nearly cancelling AR and MA factors. Unnecessary parameters inflate forecast error variance; the principle of parsimony, choosing the simplest adequate model, is central to Box-Jenkins practice.
An adequate model leaves residuals that look like white noise. The checks are: a time plot of residuals (no pattern, no change in spread); the residual ACF (no significant spikes, especially at low lags and seasonal lags); the Ljung-Box test with h - p - q degrees of freedom; a normality check (histogram, normal probability plot, Jarque-Bera); and overfitting, adding one more AR or MA term and confirming it is not significant. If diagnostics fail, the analyst returns to identification. Forecasts are computed by writing the model in difference-equation form, replacing future shocks by zero and future values by their forecasts. Forecast-error variance grows with the horizon: for a stationary model it approaches the variance of the series, while for an integrated model it grows without bound, which is why prediction intervals for prices widen quickly. Forecasts made on the log scale must be back-transformed; the simple antilog gives the median, not the mean, forecast.
Monthly and quarterly agricultural series show correlation both between adjacent months and between the same month in successive years. The seasonal ARIMA model, written ARIMA(p,d,q)(P,D,Q)s, multiplies a non-seasonal ARMA by a seasonal ARMA in the operator B to the power s: phi(B) Phi(B^s)(1 - B)^d (1 - B^s)^D Y(t) = theta(B) Theta(B^s) e(t), where s is the period (12 for monthly data) and D the number of seasonal differences. A seasonal difference, Y(t) - Y(t-12), compares each month with the same month a year earlier and removes a stable seasonal pattern; D is rarely more than 1, and d + D is rarely more than 2. The best-known example is the airline model, ARIMA(0,1,1)(0,1,1)12, which fits many monthly series with only two parameters. Its ACF has non-zero values at lags 1, 11, 12 and 13, the interaction of the two MA factors.
Seasonal orders are read from the ACF and PACF at the seasonal lags (12, 24, 36 for monthly data) in the same way that non-seasonal orders are read at lags 1, 2, 3. A slowly decaying ACF at lags 12, 24, 36 calls for a seasonal difference. After differencing, a single significant ACF spike at lag 12 with PACF decaying across 12, 24, 36 suggests a seasonal MA(1), Q = 1; a single PACF spike at lag 12 with decaying seasonal ACF suggests a seasonal AR(1), P = 1. Seasonal unit-root tests (for example the HEGY test of Hylleberg, Engle, Granger and Yoo, and the Canova-Hansen test of stable seasonality) help decide between seasonal differencing and deterministic seasonal dummies. When seasonality is deterministic, a regression on monthly dummies with ARMA errors can be better than seasonal differencing, which assumes the pattern can drift.
Agricultural series respond to outside drivers: arrivals and prices to rainfall, yields to temperature during grain filling, milk procurement to fodder prices. ARIMAX models add such covariates. The cleanest form is regression with ARMA errors: Y(t) = b0 + b1 X(t) + n(t), where the error n(t) follows an ARIMA model. If the error needs differencing, all variables are differenced together. This differs from simply adding X to an ARMA equation for Y, where the coefficient on X is harder to interpret because it is conditional on lagged Y. Transfer-function models (Box and Jenkins) generalise the idea with distributed lags of X, identified through the cross-correlation function of prewhitened series: both X and Y are filtered by the ARIMA model of X so that spurious cross-correlation from shared autocorrelation is removed. A fitted ARIMAX can only forecast Y as well as X itself can be forecast; for weather covariates, the analyst must decide whether to use climatological normals, scenario values or a weather forecast for future periods, and should say which.
Policy and shocks enter series as interventions: an export ban on onions, a new minimum support price, the closure of markets in a lockdown, a drought year. Intervention analysis models these with indicator variables. A pulse (1 in one period, 0 elsewhere) captures a one-off shock; a step (0 before a date, 1 after) captures a permanent shift; a pulse passed through a filter delta/(1 - delta B) gives a shock that decays. Outliers are classified as additive outliers (one wrong or unusual observation that does not affect later values), innovational outliers (a shock that propagates through the model's dynamics), level shifts and temporary changes. Automatic detection procedures, such as that of Chen and Liu, iterate between estimating the model and testing residuals for each outlier type. Ignoring a level shift often makes a stationary series look as if it has a unit root, which links this topic to Chapter 7.
A series with an upward drift may be trend-stationary, Y(t) = a + bt + stationary error, so that shocks die out and the series returns to its trend line, or difference-stationary, Y(t) = Y(t-1) + b + stationary error, so that shocks are permanent and the series never returns. The two look similar over a short span but imply very different forecasts and policies. Detrending a difference-stationary series leaves residuals that are not stationary; differencing a trend-stationary series over-differences it. Regressing one independent random walk on another often gives a large t-statistic and a high R-squared with a very low Durbin-Watson statistic, Granger and Newbold's spurious regression; a rule of thumb is to be suspicious when R-squared exceeds the Durbin-Watson statistic. These are the reasons unit-root testing became routine in applied work with prices and production.
In the AR(1) model Y(t) = rho Y(t-1) + e(t), a unit root means rho = 1. Subtracting Y(t-1) from both sides gives Delta Y(t) = gamma Y(t-1) + e(t), with gamma = rho - 1, and the null hypothesis of a unit root is gamma = 0 against the alternative gamma < 0 (stationarity). The test statistic is the usual t-ratio for gamma, but under the null it does not follow a t distribution; Dickey and Fuller tabulated its distribution by simulation. Three versions are used: no constant, a constant (drift), and a constant plus a time trend, and each has its own critical values; the asymptotic 5 per cent critical values are about -1.95, -2.86 and -3.41 respectively. The augmented test (ADF) adds lagged differences Delta Y(t-1), ..., Delta Y(t-k) to absorb serial correlation, with k chosen by an information criterion or by testing down. The null is rejected only when the statistic is more negative than the critical value.
The Phillips-Perron test keeps the simple Dickey-Fuller regression and corrects the statistic non-parametrically for serial correlation and heteroscedasticity, using a long-run variance estimate. The KPSS test of Kwiatkowski, Phillips, Schmidt and Shin reverses the hypotheses: its null is stationarity (around a level or a trend) and its alternative a unit root. Because unit-root tests have low power against stationary alternatives with roots near one, especially in the 20 to 40 annual observations typical of agricultural data, failure to reject a unit root is weak evidence. Using ADF and KPSS together is common: rejecting in ADF and not rejecting in KPSS supports stationarity; the reverse supports a unit root; conflicting results are reported as inconclusive. Increasing the time span of data adds more power than increasing the frequency of observation over the same span.
Perron (1989) showed that a stationary series around a trend with a one-time break, such as a jump in yield after a technology change, leads standard ADF tests to accept a unit root wrongly. He proposed tests that allow a break at a known date in the intercept, the slope or both. Because choosing the break date by looking at the data biases the test, Zivot and Andrews developed a test that searches for the break date endogenously, choosing the date that gives the strongest evidence against the unit root. Bai and Perron's method estimates multiple breaks in a regression and tests their number. For a single known break date in a regression, the Chow test compares the residual sum of squares of the pooled regression with those of the two sub-period regressions using an F-statistic; CUSUM and CUSUM-of-squares plots of recursive residuals show parameter instability without specifying a date. In agricultural series, breaks often coincide with new varieties, irrigation expansion, policy reforms and market liberalisation, and any claim of a break should be tied to such an event.
Agricultural prices show volatility clustering: calm periods and turbulent periods each persist, so large changes tend to follow large changes. Price returns, defined as r(t) = log P(t) - log P(t-1), also show fat tails (more extreme values than the normal distribution) and little autocorrelation in the returns themselves but strong autocorrelation in their squares. Volatility matters for farmers' price risk, for the design of price-stabilisation funds and buffer stocks, for futures-margin setting on commodity exchanges, for crop-insurance pricing and for value-at-risk in agricultural lending. A model with constant error variance cannot capture any of this; ARCH and GARCH models let the conditional variance change over time as a function of past information.
Engle's autoregressive conditional heteroscedasticity model, ARCH(q), writes the shock as e(t) = sigma(t) z(t), with z(t) independent with mean 0 and variance 1, and the conditional variance as sigma squared(t) = omega + alpha1 e squared(t-1) + ... + alphaq e squared(t-q), with omega > 0 and alphas non-negative. A large shock yesterday raises today's variance. Bollerslev's generalised model, GARCH(p, q), adds lagged conditional variances; the workhorse GARCH(1,1) is sigma squared(t) = omega + alpha e squared(t-1) + beta sigma squared(t-1). It is covariance stationary if alpha + beta < 1, in which case the unconditional variance is omega/(1 - alpha - beta). The sum alpha + beta measures persistence: values close to 1, common in commodity price data, mean shocks to volatility fade slowly; the half-life of a volatility shock is log(0.5)/log(alpha + beta) periods. When alpha + beta = 1 the model is integrated GARCH (IGARCH) and shocks to variance persist indefinitely. Parameters are estimated by maximum likelihood, often with a Student-t distribution for z(t) to allow fatter tails.
Engle's Lagrange-multiplier test checks for ARCH before a model is fitted: estimate the mean equation (an ARMA or regression), regress the squared residuals on a constant and q of their own lags, and compare n R-squared with chi-square on q degrees of freedom. The Ljung-Box test on squared residuals (McLeod-Li) is an alternative. After fitting GARCH, the standardised residuals e(t)/sigma(t) and their squares should show no remaining autocorrelation. Extensions handle features of real data. Asymmetric models such as Nelson's exponential GARCH (EGARCH), which models log variance and needs no sign restrictions, and the GJR or threshold GARCH, which adds a term for negative shocks, capture leverage effects in which falls and rises of the same size have different effects on volatility; for agricultural prices the asymmetry may run the other way, with price spikes raising volatility more than falls. GARCH-in-mean puts the variance in the mean equation as a risk premium. Multivariate GARCH models, for example the BEKK and dynamic conditional correlation forms, model volatility spillovers between markets, such as between international and domestic edible-oil prices.
A typical analysis takes daily or weekly prices from a market or exchange, converts them to log returns, checks stationarity, fits a mean model, tests for ARCH effects, fits GARCH(1,1) with normal and Student-t errors, compares them by information criteria and diagnostics, and reports persistence and half-life. Several cautions apply. Thin trading and government intervention, such as minimum support prices or stock limits, can make agricultural prices behave very differently from financial prices, with long flat periods and jumps. Seasonality in volatility (higher before harvest) may need seasonal dummies in the variance equation. Monthly data, the only data available for many crops and markets, smooth away much of the clustering. Forecasts of volatility converge to the unconditional variance at a rate set by alpha + beta, and should be presented as a range, not a single number.
When several series influence one another, such as wholesale and retail prices, prices in two markets, or rainfall, area and output, it is natural to model them jointly. A vector autoregression of order p, VAR(p), regresses each of k variables on p lags of all k variables: Y(t) = c + A1 Y(t-1) + ... + Ap Y(t-p) + e(t), where Y is a k x 1 vector, each A is a k x k matrix and e(t) is a vector of white-noise errors with covariance matrix Sigma. Each equation has the same regressors, so ordinary least squares equation by equation is efficient. The number of coefficients grows quickly, k squared p plus k intercepts, which limits VARs to a handful of variables or calls for Bayesian shrinkage. The lag order is chosen by information criteria (AIC, BIC, Hannan-Quinn) or likelihood-ratio tests, and the model is stable if all eigenvalues of the companion matrix lie inside the unit circle.
X is said to Granger-cause Y if past values of X improve the forecast of Y given past values of Y; in a VAR this is an F or Wald test that all lags of X in the Y equation are zero. Granger causality is about predictive content, not causation in the experimental sense, and a third variable driving both can create it. Impulse response functions trace the effect of a one-time shock in one variable on all variables over subsequent periods. Because VAR errors are correlated across equations, shocks must be orthogonalised, usually by a Cholesky decomposition of Sigma, which imposes a recursive ordering: the variable placed first affects the others within the period but is not affected by them. Results can change with the ordering, so the ordering should be justified, for example international prices before domestic prices for a small importing country, or tested with generalised impulse responses that do not depend on ordering. Forecast-error variance decomposition shows what share of each variable's forecast-error variance, at each horizon, is due to shocks in each variable.
Two I(1) series are cointegrated if some linear combination of them is stationary: they wander, but they wander together, held by an equilibrium relationship such as spatial arbitrage between markets linked by trade, or the law of one price between international and domestic prices. Engle and Granger's two-step method estimates the long-run regression Y(t) = a + b X(t) + u(t) by least squares and then applies an ADF-type test to the residuals, using special critical values (the residuals are estimated, so standard Dickey-Fuller values are too lenient). The Granger representation theorem states that cointegrated variables have an error-correction representation: Delta Y(t) = alpha (Y(t-1) - b X(t-1)) + lagged differences + e(t), where alpha, the adjustment coefficient, should be negative and measures the share of last period's disequilibrium corrected each period. The half-life of a deviation is log(0.5)/log(1 + alpha) periods. Cointegration and error-correction are the standard tools of market-integration studies in agricultural economics.
With more than two variables there can be more than one cointegrating relationship. Johansen's maximum-likelihood method works in the vector error-correction model (VECM), Delta Y(t) = Pi Y(t-1) + Gamma1 Delta Y(t-1) + ... + e(t), where Pi = alpha beta'. The rank r of Pi is the number of cointegrating vectors: r = 0 means no cointegration (a VAR in differences is appropriate), r = k means all series are stationary in levels, and 0 < r < k means cointegration with k - r common stochastic trends. Two likelihood-ratio tests based on the eigenvalues of a reduced-rank regression determine r: the trace test (null: rank at most r) and the maximum-eigenvalue test (null: rank r against r + 1). Results depend on whether intercepts and trends are allowed in the cointegrating relation or in the short-run dynamics, so the deterministic specification must be stated. Fitting a VAR in levels to cointegrated data is still consistent but loses efficiency; fitting a VAR in differences discards the long-run information and is mis-specified.
A state-space model describes an observed series through an unobserved state vector that evolves over time. The observation (measurement) equation is y(t) = Z alpha(t) + epsilon(t), and the state (transition) equation is alpha(t) = T alpha(t-1) + R eta(t), with epsilon and eta independent white-noise errors with variances H and Q. The state can hold a level, a slope, seasonal effects, regression coefficients that change over time, or the lagged values and shocks of an ARMA model; every ARIMA model and every exponential-smoothing model can be written in state-space form. The approach suits agricultural problems with unobserved quantities: the true underlying yield trend behind noisy survey estimates, the latent condition of a crop behind remote-sensing readings, or a time-varying price elasticity. Structural time-series models (Harvey) build the series from interpretable components, such as level plus slope plus seasonal plus irregular, each with its own variance.
The Kalman filter is the recursive algorithm that computes the best linear estimate of the state given observations up to time t. Each step has two parts. Prediction: a(t|t-1) = T a(t-1|t-1), with variance P(t|t-1) = T P(t-1|t-1) T' + RQR'. Update: when y(t) arrives, the prediction error v(t) = y(t) - Z a(t|t-1) has variance F(t) = Z P(t|t-1) Z' + H; the Kalman gain is K(t) = P(t|t-1) Z' F(t) inverse; the updated state is a(t|t) = a(t|t-1) + K(t) v(t), with variance P(t|t) = P(t|t-1) - K(t) Z P(t|t-1). The gain weights the new observation against the prediction: a noisy observation (large H) gets little weight; an uncertain prediction (large P) gives the observation more weight. Under normal errors the filter gives the exact conditional mean and variance, and the prediction errors and their variances give the likelihood through the prediction-error decomposition, which is how ARIMA and structural models are estimated by maximum likelihood.
The simplest structural model is the local level or random walk plus noise model: y(t) = mu(t) + epsilon(t), mu(t) = mu(t-1) + eta(t), with variances sigma squared epsilon and sigma squared eta. Their ratio q = sigma squared eta / sigma squared epsilon is the signal-to-noise ratio. For this model the filter becomes P(t|t-1) = P(t-1|t-1) + sigma squared eta, K(t) = P(t|t-1)/(P(t|t-1) + sigma squared epsilon), and mu(t|t) = mu(t|t-1) + K(t)(y(t) - mu(t|t-1)). As t grows, P and K converge to steady-state values, and the steady-state filter is exactly simple exponential smoothing with alpha equal to the steady-state gain. The model is therefore the statistical foundation of SES and is equivalent to an ARIMA(0,1,1). A larger q gives a larger gain and a forecast that follows the data closely; q = 0 gives a fixed level estimated by the overall mean.
The filter uses only past and current data; the Kalman smoother runs backwards to give the best estimate of each state using the whole sample, which is what is wanted when extracting a trend from historical data. Missing observations are handled naturally: when y(t) is missing, the update step is skipped and the prediction carries forward, which is a major practical advantage for agricultural series with gaps from market closures or survey rounds that were not conducted. Diffuse initialisation handles states with unknown starting values. Time-varying-parameter regressions, mixed-frequency models (combining monthly prices with quarterly production) and dynamic factor models are all state-space models. Non-linear and non-Gaussian problems use the extended Kalman filter, the unscented filter, particle filters, or ensemble Kalman filters; the ensemble Kalman filter is used to assimilate remote-sensing data into crop simulation models, a topic taken up in Crop Forecasting and Growth Models.
The methods so far work in the time domain, describing dependence through autocorrelations at lags. Spectral analysis describes the same information in the frequency domain: it decomposes the variance of a stationary series into contributions from cycles of different frequencies. Frequency f is measured in cycles per unit time, and the period is 1/f; in monthly data an annual cycle has f = 1/12 cycle per month. Angular frequency omega = 2 pi f is measured in radians. The fastest cycle that can be seen in data sampled once per period has f = 0.5 (a period of two observations), the Nyquist frequency; cycles faster than this are aliased, appearing at a lower frequency, which is one reason daily phenomena cannot be studied in monthly averages. The spectral density and the autocovariance function are a Fourier-transform pair: each determines the other, so the two domains carry the same information about a stationary series.
White noise has a flat spectrum: all frequencies contribute equally, as all colours do in white light. An AR(1) process with positive phi has most of its variance at low frequencies, a red spectrum, because its long slow swings dominate; with negative phi the variance moves to high frequencies. The AR(1) spectral density is proportional to 1/(1 - 2 phi cos omega + phi squared). An AR(2) process with complex roots has a peak at the frequency of its pseudo-cycle. A series with strong seasonality has peaks at the seasonal frequency and its harmonics, for monthly data at f = 1/12, 2/12, ..., 6/12. Differencing suppresses low frequencies (it is a high-pass filter), and moving averages suppress high frequencies (low-pass filters); the frequency response of a filter shows exactly which cycles it removes and which it distorts, which is how the Slutsky-Yule effect of Chapter 2 is explained.
The sample counterpart is the periodogram, computed at the Fourier frequencies f(j) = j/n for j = 1, ..., n/2. Its value at each frequency is proportional to the squared amplitude of the sine and cosine wave at that frequency fitted to the data by least squares, and the sum of the periodogram ordinates equals the total sum of squares about the mean. The raw periodogram is not a consistent estimate of the spectrum: its variance does not shrink as n grows, and it looks very jagged. Consistent estimates are obtained by smoothing across neighbouring frequencies (Daniell and other kernels) or by weighting the sample autocovariances with a lag window (Bartlett, Tukey-Hanning, Parzen windows) before transforming. Wider smoothing reduces variance but blurs peaks: the bandwidth-variance trade-off. Fisher's g-test checks whether the largest periodogram ordinate is larger than expected under white noise, a formal test for a hidden periodicity.
Spectral methods are used to detect cycles in livestock prices and herd sizes, to look for periodicities in rainfall series linked to climate oscillations, to study how seasonal adjustment filters behave, and to measure the coherence (frequency-by-frequency correlation) and phase (lead or lag) between two series, such as rainfall and yield or prices in two markets, through cross-spectral analysis. Wavelet analysis extends the idea to cycles whose frequency or strength changes over time. The limits are practical: reliable spectral estimates need long series, and with the 30 to 60 annual values typical of yield data only broad features can be distinguished. Claims of exact cycles in such short series should be treated with caution, because random variation readily produces apparent peaks.
A forecast error is e = actual - forecast. Scale-dependent measures are in the units of the data: the mean error (bias), the mean absolute error MAE = mean of |e|, the mean squared error MSE = mean of e squared, and its square root RMSE. RMSE penalises large errors more heavily than MAE and is minimised by forecasting the mean; MAE is minimised by forecasting the median. Scale-dependent measures cannot compare accuracy across series in different units or at different levels. Percentage measures can: the mean absolute percentage error MAPE = mean of |e / actual| x 100. MAPE has known faults: it is undefined when an actual value is zero and explodes when actuals are near zero (a problem for arrivals or rainfall), it is asymmetric, penalising over-forecasts of small actuals more heavily, and it is meaningless for data on an interval scale such as temperature in degrees Celsius. The symmetric MAPE was proposed to fix the asymmetry but has problems of its own.
Hyndman and Koehler proposed the mean absolute scaled error (MASE), which divides each error by the in-sample mean absolute error of the naive forecast (the one-step random-walk forecast, or the seasonal naive forecast for seasonal data). MASE below 1 means the method beats the in-sample naive forecast on average; it is defined for zero actuals and comparable across series. Theil's U statistic compares the RMSE of a forecast with that of the no-change forecast; values below 1 mean the forecast improves on no change. Relative measures of this kind answer the question managers actually ask, whether a model is worth using at all. Directional accuracy, the share of periods in which the forecast correctly predicts the direction of change, matters for trading and stock-release decisions even when RMSE is similar.
Accuracy measured on the data used to fit the model (in-sample) is always optimistic. Honest evaluation holds out the most recent part of the series as a test set, fits the model to the earlier part, and forecasts the hold-out. Better still is a rolling-origin or time-series cross-validation: fit to observations 1 to t, forecast t + h, move the origin forward, refit, and average errors over many origins. Ordinary random cross-validation is not appropriate because it uses future information to forecast the past. The horizon must match the decision: a procurement agency that commits three months ahead should judge models on three-step errors, not one-step errors. Forecast intervals should be checked for coverage: a nominal 95 per cent interval that contains the actual only 70 per cent of the time is too narrow, a common failure when parameter uncertainty and model uncertainty are ignored.
When two methods give different RMSEs on a test set, the difference may be due to chance. Diebold and Mariano proposed a test of equal predictive accuracy. Choose a loss function L (squared or absolute error) and form the loss differential d(t) = L(e1(t)) - L(e2(t)). The null hypothesis is that the expected loss differential is zero. The statistic is DM = d-bar / sqrt(V/n), where d-bar is the mean loss differential and V is an estimate of the long-run variance of d(t), which allows for autocorrelation: h-step forecast errors are autocorrelated up to lag h - 1, so V includes autocovariances up to that lag. Under the null, DM is asymptotically standard normal. Harvey, Leybourne and Newbold proposed a small-sample correction that multiplies the statistic by a factor depending on n and h and uses Student-t critical values. The test treats the forecasts as given; for comparing nested models estimated on the same data, other tests (such as Clark and West's) are more appropriate. Combining forecasts, for example by a simple average, often beats the best single method, a robust finding of forecasting research.
A student must be able to decompose a monthly price series into trend and seasonal indices by hand, read a correlogram, say whether a series needs differencing, write down an AR(1), MA(1) or ARMA(1,1) and its key properties, identify a tentative ARIMA model from ACF and PACF plots, and interpret a Dickey-Fuller result. In examinations this means quick calculations: a seasonal index adjustment, a Yule-Walker estimate, a Ljung-Box degree of freedom, a GARCH unconditional variance or half-life, the MAPE of a short forecast. In a thesis it means fitting and checking a model in software and defending each choice.
Five years into work at a state agricultural marketing board, a commodity desk or a dairy cooperative, the statistician builds and maintains monthly forecasts of arrivals, prices and procurement. The routine tasks are cleaning series (outliers, market closures), seasonal adjustment, fitting SARIMA or Holt-Winters models, adding rainfall or policy dummies, evaluating models on rolling origins with MAPE and MASE, and explaining forecast ranges to managers who want a single number. The practitioner knows when a simple seasonal naive forecast is good enough and when the extra effort of a structural model pays.
A senior economist or head of a statistics division with 25 years of experience decides which forecasting systems an organisation relies on and how forecasts feed decisions on procurement, buffer-stock release, export policy and price-stabilisation funds. The questions at this level are about robustness and governance: whether forecast errors have been tracked over years, whether models broke after policy changes, how volatility estimates inform stock-holding and hedging, how market-integration studies inform where to intervene, and how to communicate uncertainty to ministers without false precision.
A professor or research leader works at the edge of the field: state-space and Bayesian models for agricultural series with gaps and mixed frequencies, multivariate GARCH for volatility transmission across borders, threshold and non-linear cointegration for markets with transaction costs, forecast combination and density forecasting, and hybrid statistical and machine-learning models. The research leader supervises theses, referees papers whose unit-root and cointegration claims often rest on short, broken series, and sets standards for honest out-of-sample evaluation in applied agricultural forecasting.
This manual introduces spectral analysis but does not derive spectral estimators or treat multitaper and wavelet methods in depth. Long-memory (ARFIMA) models, non-linear models such as threshold autoregression and Markov switching, panel unit-root and panel cointegration tests, Bayesian VARs and density-forecast evaluation are named but not developed. Critical values are quoted only where they are standard asymptotic values; finite-sample tables must be read from the original sources or software. Worked examples use illustrative numbers, not real market data.
Original practice questions written to the syllabus and pattern of the exams named in each question's examTags. They are not past papers and do not reproduce any board's questions. Every numerical answer was computed with a script; the values needed are stated in the question.
These notes are free to read here, with no account.
What the Laisha app adds:
Free for ten days, then a subscription. We would rather write that here than have you find it later.