PDF version (NAG web site
, 64bit version, 64bit version)
NAG Toolbox Chapter Introduction
G13 — Time Series Analysis
Scope of the Chapter
This chapter provides facilities for investigating and modelling the statistical structure of series of observations collected at equally spaced points in time. The models may then be used to forecast the series.
The chapter covers the following models and approaches.
 Univariate time series analysis, including autocorrelation functions and autoregressive moving average (ARMA) models.
 Univariate spectral analysis.
 Transfer function (multiinput) modelling, in which one time series is dependent on other time series.
 Bivariate spectral methods including coherency, gain and input response functions.
 Vector ARMA models for multivariate time series.
 Kalman filter models.
 GARCH models for volatility.
Background to the Problems
Univariate Analysis
Let the given time series be
x_{1},x_{2}, … ,x_{n}${x}_{1},{x}_{2},\dots ,{x}_{n}$, where
n$n$ is its length. The structure which is intended to be investigated, and which may be most evident to the eye in a graph of the series, can be broadly described as:
(a) 
trends, linear or possibly higherorder polynomial; 
(b) 
seasonal patterns, associated with fixed integer seasonal periods. The presence of such seasonality and the period will normally be known a priori. The pattern may be fixed, or slowly varying from one season to another; 
(c) 
cycles or waves of stable amplitude and period p$p$ (from peak to peak). The period is not necessarily integer, the corresponding absolute frequency (cycles/time unit) being f = 1 / p$f=1/p$ and angular frequency ω = 2πf$\omega =2\pi f$. The cycle may be of pure sinusoidal form like sin(ωt)$\mathrm{sin}\left(\omega t\right)$, or the presence of higher harmonic terms may be indicated, e.g., by asymmetry in the wave form; 
(d) 
quasicycles, i.e., waves of fluctuating period and amplitude; and 
(e) 
irregular statistical fluctuations and swings about the overall mean or trend. 
Trends, seasonal patterns, and cycles might be regarded as deterministic components following fixed mathematical equations, and the quasicycles and other statistical fluctuations as stochastic and describable by shortterm correlation structure. For a finite dataset it is not always easy to discriminate between these two types, and a common description using the class of autoregressive integrated movingaverage (ARIMA) models is now widely used. The form of these models is that of difference equations (or recurrence relations) relating present and past values of the series. You are referred to
Box and Jenkins (1976) for a thorough account of these models and how to use them. We follow their notation and outline the recommended steps in ARIMA model building for which functions are available.
Transformations
If the variance of the observations in the series is not constant across the range of observations it may be useful to apply a variancestabilizing transformation to the series. A common situation is for the variance to increase with the magnitude of the observations and in this case typical transformations used are the log or square root transformation. A rangemean plot or standard deviationmean plot provides a quick and easy way of detecting nonconstant variance and of choosing, if required, a suitable transformation. These are plots of either the range or standard deviation of successive groups of observations against their means.
Differencing operations
These may be used to simplify the structure of a time series.
Firstorder differencing, i.e., forming the new series
will remove a linear trend. Firstorder seasonal differencing
eliminates a fixed seasonal pattern.
These operations reflect the fact that it is often appropriate to model a time series in terms of changes from one value to another. Differencing is also therefore appropriate when the series has something of the nature of a random walk, which is by definition the accumulation of independent changes.
Differencing may be applied repeatedly to a series, giving
where
d$d$ and
D$D$ are the orders of differencing. The derived series
w_{t}${w}_{t}$ will be shorter, of length
N = n − d − s × D$N=nds\times D$, and extend for
t = 1 + d + s × D, … ,n$t=1+d+s\times D,\dots ,n$.
Sample autocorrelations
Given that a series has (possibly as a result of simplifying by differencing operations) a homogeneous appearance throughout its length, fluctuating with approximately constant variance about an overall mean level, it is appropriate to assume that its statistical properties are stationary. For most purposes the correlations ρ_{k}${\rho}_{k}$ between terms x_{t},x_{t + k}${x}_{t},{x}_{t+k}$ or w_{t},w_{t + k}${w}_{t},{w}_{t+k}$ separated by lag k$k$ give an adequate description of the statistical structure and are estimated by the sample autocorrelation function (ACF) r_{k}${r}_{\mathit{k}}$, for k = 1,2, … $\mathit{k}=1,2,\dots $.
As described by
Box and Jenkins (1976), these may be used to indicate which particular ARIMA model may be appropriate.
Partial autocorrelations
The information in the autocorrelations, ρ_{k}${\rho}_{k}$, may be presented in a different light by deriving from them the coefficients of the partial autocorrelation function (PACF) φ_{k,k}${\varphi}_{\mathit{k},\mathit{k}}$, for k = 1,2, … $\mathit{k}=1,2,\dots $. φ_{k,k}${\varphi}_{k,k}$ which measures the correlation between x_{t}${x}_{t}$ and x_{t + k}${x}_{t+k}$ conditional upon the intermediate values x_{t + 1},x_{t + 2}, … ,x_{t + k − 1}${x}_{t+1},{x}_{t+2},\dots ,{x}_{t+k1}$. The corresponding sample values ϕ̂_{k,k}${\hat{\varphi}}_{k,k}$ give further assistance in the selection of ARIMA models.
Both autocorrelation function (ACF) and PACF may be rapidly computed, particularly in comparison with the time taken to estimate ARIMA models.
Finite lag predictor coefficients and error variances
The partial autocorrelation coefficient
φ_{k,k}${\varphi}_{k,k}$ is determined as the final parameter in the minimum variance predictor of
x_{t}${x}_{t}$ in terms of
x_{t − 1},x_{t − 2}, … ,x_{t − k}${x}_{t1},{x}_{t2},\dots ,{x}_{tk}$,
where
e_{k,t}${e}_{k,t}$ is the prediction error, and the first subscript
k$k$ of
φ_{k,i}${\varphi}_{k,i}$ and
e_{k,t}${e}_{k,t}$ emphasizes the fact that the parameters will alter as
k$k$ increases. Moderately good estimates
ϕ̂_{k,i}${\hat{\varphi}}_{k,i}$ of
φ_{k,i}${\varphi}_{k,i}$ are obtained from the sample autocorrelation function (ACF), and after calculating the partial autocorrelation function (PACF) up to lag
L$L$, the successive values
v_{1},v_{2}, … ,v_{L}${v}_{1},{v}_{2},\dots ,{v}_{L}$ of the prediction error variance estimates,
v_{k} = var(e_{k,t})${v}_{k}=\mathrm{var}\left({e}_{k,t}\right)$, are available, together with the final values of the coefficients
ϕ̂_{k,1},ϕ̂_{k,2}, … ,ϕ̂_{k,L}${\hat{\varphi}}_{k,1},{\hat{\varphi}}_{k,2},\dots ,{\hat{\varphi}}_{k,L}$. If
x_{t}${x}_{t}$ has nonzero mean,
x$\stackrel{}{x}$, it is adequate to use
x_{t} − x${x}_{t}\stackrel{}{x}$ in place of
x_{t}${x}_{t}$ in the prediction equation.
Although
Box and Jenkins (1976) do not place great emphasis on these prediction coefficients, their use is advocated for example by
Akaike (1971), who recommends selecting an optimal order of the predictor as the lag for which the final prediction error (FPE) criterion
(1 + k / n)(1 − k / n)^{ − 1}v_{k}$(1+k/n){(1k/n)}^{1}{v}_{k}$ is a minimum.
ARIMA models
The correlation structure in stationary time series may often be represented by a model with a small number of parameters belonging to the autoregressive movingaverage (ARMA) class. If the stationary series
w_{t}${w}_{t}$ has been derived by differencing from the original series
x_{t}${x}_{t}$, then
x_{t}${x}_{t}$ is said to follow an ARIMA model. Taking
w_{t} = ∇^{d}x_{t}${w}_{t}={\nabla}^{d}{x}_{t}$, the (nonseasonal) ARIMA
(p,d,q)$(p,d,q)$ model with
p$p$ autoregressive parameters
φ_{1},φ_{2}, … ,φ_{p}${\varphi}_{1},{\varphi}_{2},\dots ,{\varphi}_{p}$ and
q$q$ movingaverage parameters
θ_{1},θ_{2}, … ,θ_{q}${\theta}_{1},{\theta}_{2},\dots ,{\theta}_{q}$, represents the structure of
w_{t}${w}_{t}$ by the equation
where
a_{t}${a}_{t}$ is an uncorrelated series (white noise) with mean
0$0$ and constant variance
σ_{a}^{2}${\sigma}_{a}^{2}$. If
w_{t}${w}_{t}$ has a nonzero mean
c$c$, then this is allowed for by replacing
w_{t},w_{t − 1}, … ${w}_{t},{w}_{t1},\dots \text{}$ by
w_{t} − c,w_{t − 1} − c, … ${w}_{t}c,{w}_{t1}c,\dots \text{}$ in the model. Although
c$c$ is often estimated by the sample mean of
w_{t}${w}_{t}$ this is not always optimal.
A series generated by this model will only be stationary provided restrictions are placed on
φ_{1},φ_{2}, … ,φ_{p}${\varphi}_{1},{\varphi}_{2},\dots ,{\varphi}_{p}$ to avoid unstable growth of
w_{t}${w}_{t}$. These are called stationarity constraints. The series
a_{t}${a}_{t}$ may also be usefully interpreted as the linear innovations in
x_{t}${x}_{t}$ (and in
w_{t}${w}_{t}$), i.e., the error if
x_{t}${x}_{t}$ were to be predicted using the information in all past values
x_{t − 1},x_{t − 2}, … ${x}_{t1},{x}_{t2},\dots \text{}$, provided also that
θ_{1},θ_{2}, … ,θ_{q}${\theta}_{1},{\theta}_{2},\dots ,{\theta}_{q}$ satisfy invertibility constraints. This allows the series
a_{t}${a}_{t}$ to be regenerated by rewriting the model equation as
For a series with shortterm correlation only, i.e.,
r_{k}${r}_{k}$ is not significant beyond some low lag
q$q$ (see
Box and Jenkins (1976) for the statistical test), then the pure movingaverage model
MA(q)$\text{MA}\left(q\right)$ is appropriate, with no autoregressive parameters, i.e.,
p = 0$p=0$.
Autoregressive parameters are appropriate when the autocorrelation function (ACF) pattern decays geometrically, or with a damped sinusoidal pattern which is associated with quasiperiodic behaviour in the series. If the sample partial autocorrelation function (PACF) ϕ̂_{k,k}${\hat{\varphi}}_{k,k}$ is significant only up to some low lag p$p$, then a pure autoregressive model AR(p)$\text{AR}\left(p\right)$ is appropriate, with q = 0$q=0$. Otherwise movingaverage terms will need to be introduced, as well as autoregressive terms.
The seasonal ARIMA
(p,d,q,P,D,Q,s)$(p,d,q,P,D,Q,s)$ model allows for correlation at lags which are multiples of the seasonal period
s$s$. Taking
w_{t} = ∇^{d}∇_{s}^{D}x_{t}${w}_{t}={\nabla}^{d}{\nabla}_{s}^{D}{x}_{t}$, the series is represented in a twostage manner via an intermediate series
e_{t}${e}_{t}$:
where
Φ_{i}${\Phi}_{i}$,
Θ_{i}${\Theta}_{i}$ are the seasonal parameters and
P$P$ and
Q$Q$ are the corresponding orders. Again,
w_{t}${w}_{t}$ may be replaced by
w_{t} − c${w}_{t}c$.
ARIMA model estimation
In theory, the parameters of an ARIMA model are determined by a sufficient number of autocorrelations ρ_{1},ρ_{2}, … ${\rho}_{1},{\rho}_{2},\dots \text{}$. Using the sample values r_{1},r_{2}, … ${r}_{1},{r}_{2},\dots \text{}$ in their place it is usually (but not always) possible to solve for the corresponding ARIMA parameters.
These are rapidly computed but are not fully efficient estimates, particularly if movingaverage parameters are present. They do provide useful preliminary values for an efficient but relatively slow iterative method of estimation. This is based on the least squares principle by which parameters are chosen to minimize the sum of squares of the innovations
a_{t}${a}_{t}$, which are regenerated from the data using
(2), or the reverse of
(3) and
(4) in the case of seasonal models.
Lack of knowledge of terms on the righthand side of
(2), when
t = 1,2, … ,max (p,q)$t=1,2,\dots ,\mathrm{max}\phantom{\rule{0.125em}{0ex}}(p,q)$, is overcome by introducing
q$q$ unknown series values
w_{0},w_{1}, … ,w_{q − 1}${w}_{0},{w}_{1},\dots ,{w}_{q1}$ which are estimated as nuisance parameters, and using correction for transient errors due to the autoregressive terms. If the data
w_{1},w_{2}, … ,w_{N} = w${w}_{1},{w}_{2},\dots ,{w}_{N}=w$ is viewed as a single sample from a multivariate Normal density whose covariance matrix
V$V$ is a function of the ARIMA model parameters, then the exact likelihood of the parameters is
The least squares criterion as outlined above is equivalent to using the quadratic form
as an objective function to be minimized. Neglecting the term
− (1/2)logV$\frac{1}{2}\mathrm{log}\leftV\right$ yields estimates which differ very little from the exact likelihood except in small samples, or in seasonal models with a small number of whole seasons contained in the data. In these cases bias in movingaverage parameters may cause them to stick at the boundary of their constraint region, resulting in failure of the estimation method.
Approximate standard errors of the parameter estimates and the correlations between them are available after estimation.
The model residuals, â_{t}${\hat{a}}_{t}$, are the innovations resulting from the estimation and are usually examined for the presence of autocorrelation as a check on the adequacy of the model.
ARIMA model forecasting
An ARIMA model is particularly suited to extrapolation of a time series. The model equations are simply used for t = n + 1,n + 2, … $t=n+1,n+2,\dots \text{}$ replacing the unknown future values of a_{t}${a}_{t}$ by zero. This produces future values of w_{t}${w}_{t}$, and if differencing has been used this process is reversed (the socalled integration part of ARIMA models) to construct future values of x_{t}${x}_{t}$.
Forecast error limits are easily deduced.
This process requires knowledge only of the model orders and parameters together with a limited set of the terms
a_{t − i},e_{t − i},w_{t − i},x_{t − i}${a}_{ti},{e}_{ti},{w}_{ti},{x}_{ti}$ which appear on the righthand side of the models
(3) and
(4) (and the differencing equations) when
t = n$t=n$. It does not require knowledge of the whole series.
We call this the state set. It is conveniently constituted after model estimation. Moreover, if new observations x_{n + 1},x_{n + 2}, … ${x}_{n+1},{x}_{n+2},\dots \text{}$ come to hand, then the model equations can easily be used to update the state set before constructing forecasts from the end of the new observations. This is particularly useful when forecasts are constructed on a regular basis. The new innovations a_{n + 1},a_{n + 2}, … ${a}_{n+1},{a}_{n+2},\dots \text{}$ may be compared with the residual standard deviation, σ_{a}${\sigma}_{a}$, of the model used for forecasting, as a check that the model is continuing to forecast adequately.
Exponential Smoothing
Exponential smoothing is a relatively simple method of short term forecasting for a time series. A variety of different smoothing methods are possible, including; single exponential, Brown's double exponential, linear Holt (also called double exponential smoothing in some references), additive Holt–Winters and multiplicative Holt–Winters. The choice of smoothing method used depends on the characteristics of the time series. If the mean of the series is only slowly changing then single exponential smoothing may be suitable. If there is a trend in the time series, which itself may be slowly changing, then linear Holt smoothing may be suitable. If there is a seasonal component to the time series, e.g., daily or monthly data, then one of the two Holt–Winters methods may be suitable.
For a time series
y_{t}${y}_{\mathit{t}}$, for
t = 1,2, … ,n$\mathit{t}=1,2,\dots ,n$, the five smoothing functions are defined by the following:
 Single Exponential Smoothing
 Brown Double Exponential Smoothing
 Linear Holt Smoothing
 Additive Holt–Winters Smoothing
 Multiplicative Holt–Winters Smoothing
$$\begin{array}{ccc}\hfill {m}_{t}& =& \alpha {y}_{t}/{s}_{tp}+(1\alpha )({m}_{t1}+\varphi {r}_{t1})\hfill \\ \hfill {r}_{t}& =& \gamma ({m}_{t}{m}_{t1})+(1\gamma )\varphi {r}_{t1}\hfill \\ \hfill {s}_{t}& =& \beta {y}_{t}/{m}_{t}+(1\beta ){s}_{tp}\hfill \\ \hfill {\hat{y}}_{t+f}& =& ({m}_{t}+\sum _{\mathit{i}=1}^{f}{\varphi}^{i}{r}_{t})\times {s}_{tp}\hfill \\ \hfill \mathrm{var}\left({\hat{y}}_{t+f}\right)& =& \mathrm{var}\left({\epsilon}_{t}\right)\left(\sum _{\mathit{i}=0}^{\infty}\sum _{\mathit{j}=0}^{p1}{\left({\psi}_{j+ip}\frac{{s}_{t+f}}{{s}_{t+fj}}\right)}^{2}\right)\hfill \end{array}$$
and ψ$\psi $ is defined as in the additive Holt–Winters smoothing,
where m_{t}${m}_{t}$ is the mean, r_{t}${r}_{t}$ is the trend and s_{t}${s}_{t}$ is the seasonal component at time t$t$ with p$p$ being the seasonal order. The f$f$step ahead forecasts are given by ŷ_{t + f}${\hat{y}}_{t+f}$ and their variances by
var(ŷ_{t + f})
$\mathrm{var}\left({\hat{y}}_{t+f}\right)$. The term
var(ε_{t})
$\mathrm{var}\left({\epsilon}_{t}\right)$ is estimated as the mean deviation.The parameters, α$\alpha $, β$\beta $ and γ$\gamma $ control the amount of smoothing. The nearer these parameters are to one, the greater the emphasis on the current data point. Generally these parameters take values in the range 0.1$0.1$ to 0.3$0.3$. The linear Holt and two Holt–Winters smoothers include an additional parameter, φ$\varphi $, which acts as a trend dampener. For 0.0 < φ < 1.0$0.0<\varphi <1.0$ the trend is dampened and for φ > 1.0$\varphi >1.0$ the forecast function has an exponential trend, φ = 0.0$\varphi =0.0$ removes the trend term from the forecast function and φ = 1.0$\varphi =1.0$ does not dampen the trend.
For all methods, values for α$\alpha $, β$\beta $, γ$\gamma $ and ψ$\psi $ can be chosen by trying different values and then visually comparing the results by plotting the fitted values along side the original data. Alternatively, for single exponential smoothing a suitable value for α$\alpha $ can be obtained by fitting an ARIMA(0,1,1)$\mathrm{ARIMA}(0,1,1)$ model. For Brown's double exponential smoothing and linear Holt smoothing with no dampening, (i.e., φ = 1.0$\varphi =1.0$), suitable values for α$\alpha $ and, in the case of linear Holt smoothing, γ$\gamma $ can be obtained by fitting an ARIMA(0,2,2)$\mathrm{ARIMA}(0,2,2)$ model. Similarly, the linear Holt method, with φ ≠ 1.0$\varphi \ne 1.0$, can be expressed as an ARIMA(1,2,2)$\mathrm{ARIMA}(1,2,2)$ model and the additive Holt–Winters, with no dampening, (φ = 1.0$\varphi =1.0$), can be expressed as a seasonal ARIMA model with order p$p$ of the form ARIMA(0,1,p + 1)(0,1,0)$\mathrm{ARIMA}(0,1,p+1)(0,1,0)$. There is no similar procedure for obtaining parameter values for the multiplicative Holt–Winters method, or the additive Holt–Winters method with φ ≠ 1.0$\varphi \ne 1.0$. In these cases parameters could be selected by minimizing a measure of fit using nonlinear optimization.
Univariate Spectral Analysis
In describing a time series using spectral analysis the fundamental components are taken to be sinusoidal waves of the form
Rcos(ωt + φ)$R\mathrm{cos}(\omega t+\varphi )$, which for a given angular frequency
ω$\omega $,
0 ≤ ω ≤ π$0\le \omega \le \pi $, is specified by its amplitude
R > 0$R>0$ and phase
φ$\varphi $,
0 ≤ φ < 2π$0\le \varphi <2\pi $. Thus in a time series of
n$n$ observations it is not possible to distinguish more than
n / 2$n/2$ independent sinusoidal components. The frequency range
0 ≤ ω ≤ π$0\le \omega \le \pi $ is limited to the shortest wavelength of two sampling units because any wave of higher frequency is indistinguishable upon sampling (or is aliased with) a wave within this range. Spectral analysis follows the idea that for a series made up of a finite number of sine waves the amplitude of any component at frequency
ω$\omega $ is given to order
1 / n$1/n$ by
The sample spectrum
For a series
x_{1},x_{2}, … ,x_{n}${x}_{1},{x}_{2},\dots ,{x}_{n}$ this is defined as
the scaling factor now being chosen in order that
i.e., the spectrum indicates how the sample variance (
σ_{x}^{2}${\sigma}_{x}^{2}$) of the series is distributed over components in the frequency range
0 ≤ ω ≤ π$0\le \omega \le \pi $.
It may be demonstrated that
f^{*}(ω)${f}^{*}\left(\omega \right)$ is equivalently defined in terms of the sample ACF
r_{k}${r}_{k}$ of the series as
where
c_{k} = σ_{x}^{2}r_{k}${c}_{k}={\sigma}_{x}^{2}{r}_{k}$ are the sample autocovariance coefficients.
If the series x_{t}${x}_{t}$ does contain a deterministic sinusoidal component of amplitude R$R$, this will be revealed in the sample spectrum as a sharp peak of approximate width π / n$\pi /n$ and height (n / 2π)R^{2}$(n/2\pi ){R}^{2}$. This is called the discrete part of the spectrum, the variance R^{2}${R}^{2}$ associated with this component being in effect concentrated at a single frequency.
If the series
x_{t}${x}_{t}$ has no deterministic components, i.e., is purely stochastic being stationary with autocorrelation function (ACF)
r_{k}${r}_{k}$, then with increasing sample size the expected value of
f^{*}(ω)${f}^{*}\left(\omega \right)$ converges to the theoretical spectrum – the continuous part
where
γ_{k}${\gamma}_{k}$ are the theoretical autocovariances.
The sample spectrum does not however converge to this value but at each frequency point fluctuates about the theoretical spectrum with an exponential distribution, being independent at frequencies separated by an interval of 2π / n$2\pi /n$ or more. Various devices are therefore employed to smooth the sample spectrum and reduce its variability. Much of the strength of spectral analysis derives from the fact that the error limits are multiplicative so that features may still show up as significant in a part of the spectrum which has a generally low level, whereas they are completely masked by other components in the original series. The spectrum can help to distinguish deterministic cyclical components from the stochastic quasicycle components which produce a broader peak in the spectrum. (The deterministic components can be removed by regression and the remaining part represented by an ARIMA model.)
A large discrete component in a spectrum can distort the continuous part over a large frequency range surrounding the corresponding peak. This may be alleviated at the cost of slightly broadening the peak by tapering a portion of the data at each end of the series with weights which decay smoothly to zero. It is usual to correct for the mean of the series and for any linear trend by simple regression, since they would similarly distort the spectrum.
Spectral smoothing by lag window
The estimate is calculated directly from the sample autocovariances
c_{k}${c}_{k}$ as
the smoothing being induced by the lag window weights
w_{k}${w}_{k}$ which extend up to a truncation lag
M$M$ which is generally much less than
n$n$. The smaller the value of
M$M$, the greater the degree of smoothing, the spectrum estimates being independent only at a wider frequency separation indicated by the bandwidth
b$b$ which is proportional to
1 / M$1/M$. It is wise, however, to calculate the spectrum at intervals appreciably less than this. Although greater smoothing narrows the error limits, it can also distort the spectrum, particularly by flattening peaks and filling in troughs.
Direct spectral smoothing
The unsmoothed sample spectrum is calculated for a fine division of frequencies, then averaged over intervals centred on each frequency point for which the smoothed spectrum is required. This is usually at a coarser frequency division. The bandwidth corresponds to the width of the averaging interval.
Linear Lagged Relationships Between Time Series
We now consider the context in which one time series, called the dependent or output series,
y_{1},y_{2}, … ,y_{n}${y}_{1},{y}_{2},\dots ,{y}_{n}$, is believed to depend on one or more explanatory or input series, e.g.,
x_{1},x_{2}, … ,x_{n}${x}_{1},{x}_{2},\dots ,{x}_{n}$. This dependency may follow a simple linear regression, e.g.,
or more generally may involve lagged values of the input
The sequence
v_{0},v_{1},v_{2}, … ${v}_{0},{v}_{1},{v}_{2},\dots \text{}$ is called the impulse response function (IRF) of the relationship. The term
n_{t}${n}_{t}$ represents that part of
y_{t}${y}_{t}$ which cannot be explained by the input, and it is assumed to follow a univariate ARIMA model. We call
n_{t}${n}_{t}$ the (output) noise component of
y_{t}${y}_{t}$, and it includes any constant term in the relationship. It is assumed that the input series,
x_{t}${x}_{t}$, and the noise component,
n_{t}${n}_{t}$, are independent.
The part of
y_{t}${y}_{t}$ which is explained by the input is called the input component
z_{t}${z}_{t}$:
so
y_{t} = z_{t} + n_{t}${y}_{t}={z}_{t}+{n}_{t}$.
The eventual aim is to model both these components of
y_{t}${y}_{t}$ on the basis of observations of
y_{1},y_{2}, … ,y_{n}${y}_{1},{y}_{2},\dots ,{y}_{n}$ and
x_{1},x_{2}, … ,x_{n}${x}_{1},{x}_{2},\dots ,{x}_{n}$. In applications to forecasting or control both components are important. In general there may be more than one input series, e.g.,
x_{1,t}${x}_{1,t}$ and
x_{2,t}${x}_{2,t}$, which are assumed to be independent and corresponding components
z_{1,t}${z}_{1,t}$ and
z_{2,t}${z}_{2,t}$, so
Transfer function models
In a similar manner to that in which the structure of a univariate series may be represented by a finiteparameter ARIMA model, the structure of an input component may be represented by a transfer function (TF) model with delay time
b$b$,
p$p$ autoregressivelike parameters
δ_{1},δ_{2}, … ,δ_{p}${\delta}_{1},{\delta}_{2},\dots ,{\delta}_{p}$ and
q + 1$q+1$ movingaveragelike parameters
ω_{0},ω_{1}, … ,ω_{q}${\omega}_{0},{\omega}_{1},\dots ,{\omega}_{q}$:
If
p > 0$p>0$ this represents an impulse response function (IRF) which is infinite in extent and decays with geometric and/or sinusoidal behaviour. The parameters
δ_{1},δ_{2}, … ,δ_{p}${\delta}_{1},{\delta}_{2},\dots ,{\delta}_{p}$ are constrained to satisfy a stability condition identical to the stationarity condition of autoregressive models. There is no constraint on
ω_{0},ω_{1}, … ,ω_{q}${\omega}_{0},{\omega}_{1},\dots ,{\omega}_{q}$.
Crosscorrelations
An important tool for investigating how an input series
x_{t}${x}_{t}$ affects an output series
y_{t}${y}_{t}$ is the sample crosscorrelation function (CCF)
r_{xy}(k)${r}_{xy}\left(\mathit{k}\right)$, for
k = 0,1, … $\mathit{k}=0,1,\dots $ between the series. If
x_{t}${x}_{t}$ and
y_{t}${y}_{t}$ are (jointly) stationary time series this is an estimator of the theoretical quantity
The sequence
r_{yx}(k)${r}_{yx}\left(\mathit{k}\right)$, for
k = 0,1, … $\mathit{k}=0,1,\dots $, is distinct from
r_{xy}(k)${r}_{xy}\left(k\right)$, though it is possible to interpret
When the series
y_{t}${y}_{t}$ and
x_{t}${x}_{t}$ are believed to be related by a transfer function (TF) model, the CCF is determined by the impulse response function (IRF)
v_{0},v_{1},v_{2}, … ${v}_{0},{v}_{1},{v}_{2},\dots \text{}$ and the autocorrelation function (ACF) of the input
x_{t}${x}_{t}$.
In the particular case when
x_{t}${x}_{t}$ is an uncorrelated series or white noise (and is uncorrelated with any other inputs):
and the sample CCF can provide an estimate of
v_{k}${v}_{k}$:
where
s_{y}${s}_{y}$ and
s_{x}${s}_{x}$ are the sample standard deviations of
y_{t}${y}_{t}$ and
x_{t}${x}_{t}$, respectively.
In theory the IRF coefficients v_{b}, … ,v_{b + p + q}${v}_{b},\dots ,{v}_{b+p+q}$ determine the parameters in the TF model, and using ṽ_{k}${\stackrel{~}{v}}_{k}$ to estimate ṽ_{k}${\stackrel{~}{v}}_{k}$ it is possible to solve for preliminary estimates of δ_{1},δ_{2}, … ,δ_{p}${\delta}_{1},{\delta}_{2},\dots ,{\delta}_{p}$, ω_{0},ω_{1}, … ,ω_{q}${\omega}_{0},{\omega}_{1},\dots ,{\omega}_{q}$.
Prewhitening or filtering by an ARIMA model
In general an input series
x_{t}${x}_{t}$ is not white noise, but may be represented by an ARIMA model with innovations or residuals
a_{t}${a}_{t}$ which are white noise. If precisely the same operations by which
a_{t}${a}_{t}$ is generated from
x_{t}${x}_{t}$ are applied to the output
y_{t}${y}_{t}$ to produce a series
b_{t}${b}_{t}$, then the transfer function relationship between
y_{t}${y}_{t}$ and
x_{t}${x}_{t}$ is preserved between
b_{t}${b}_{t}$ and
a_{t}${a}_{t}$. It is then possible to estimate
The procedure of generating
a_{t}${a}_{t}$ from
x_{t}${x}_{t}$ (and
b_{t}${b}_{t}$ from
y_{t}${y}_{t}$) is called prewhitening or filtering by an ARIMA model. Although
a_{t}${a}_{t}$ is necessarily white noise, this is not generally true of
b_{t}${b}_{t}$.
Multiinput model estimation
The term multiinput model is used for the situation when one output series
y_{t}${y}_{t}$ is related to one or more input series
x_{j,t}${x}_{j,t}$, as described in
Section [Linear Lagged Relationships Between Time Series]. If for a given input the relationship is a simple linear regression, it is called a simple input; otherwise it is a transfer function input. The error or noise term follows an ARIMA model.
Given that the orders of all the transfer function models and the ARIMA model of a multiinput model have been specified, the various parameters in those models may be (simultaneously) estimated.
The procedure used is closely related to the least squares principle applied to the innovations in the ARIMA noise model.
The innovations are derived for any proposed set of parameter values by calculating the response of each input to the transfer functions and then evaluating the noise
n_{t}${n}_{t}$ as the difference between this response (combined for all the inputs) and the output. The innovations are derived from the noise using the ARIMA model in the same manner as for a univariate series, and as described in
Section [ARIMA models].
In estimating the parameters, consideration has to be given to the lagged terms in the various model equations which are associated with times prior to the observation period, and are therefore unknown. The function descriptions provide the necessary detail as to how this problem is treated.
Also, as described in
Section [ARIMA model estimation] the sum of squares criterion
is related to the quadratic form in the exact loglikelihood of the parameters:
Here
w$w$ is the vector of appropriately differenced noise terms, and
where
σ_{a}^{2}${\sigma}_{a}^{2}$ is the innovation variance parameter.
The least squares criterion is therefore identical to minimization of the quadratic form, but is not identical to exact likelihood. Because
V$V$ may be expressed as
Mσ_{a}^{2}$M{\sigma}_{a}^{2}$, where
M$M$ is a function of the ARIMA model parameters, substitution of
σ_{a}^{2}${\sigma}_{a}^{2}$ by its maximum likelihood (ML) estimator yields a concentrated (or profile) likelihood which is a function of
N$N$ is the length of the differenced noise series
w$w$, and
M = detM$\leftM\right=\mathrm{det}M$.
Use of the above quantity, called the deviance, D$D$, as an objective function is preferable to the use of S$S$ alone, on the grounds that it is equivalent to exact likelihood, and yields estimates with better properties. However, there is an appreciable computational penalty in calculating D$D$, and in large samples it differs very little from S$S$, except in the important case of seasonal ARIMA models where the number of whole seasons within the data length must also be large.
You are given the option of taking the objective function to be either S$S$ or D$D$, or a third possibility, the marginal likelihood. This is similar to exact likelihood but can counteract bias in the ARIMA model due to the fitting of a large number of simple inputs.
Approximate standard errors of the parameter estimates and the correlations between them are available after estimation.
The model residuals â_{t}${\hat{a}}_{t}$ are the innovations resulting from the estimation, and they are usually examined for the presence of either autocorrelation or crosscorrelation with the inputs. Absence of such correlation provides some confirmation of the adequacy of the model.
Multiinput model forecasting
A multiinput model may be used to forecast the output series provided future values (possibly forecasts) of the input series are supplied.
Construction of the forecasts requires knowledge only of the model orders and parameters, together with a limited set of the most recent variables which appear in the model equations. This is called the state set. It is conveniently constituted after model estimation. Moreover, if new observations y_{n + 1},y_{n + 2}, … ${y}_{n+1},{y}_{n+2},\dots \text{}$ of the output series and x_{n + 1},x_{n + 2}, … ${x}_{n+1},{x}_{n+2},\dots \text{}$ of (all) the independent input series become available, then the model equations can easily be used to update the state set before constructing forecasts from the end of the new observations. The new innovations a_{n + 1},a_{n + 2}, … ${a}_{n+1},{a}_{n+2},\dots \text{}$ generated in this updating may be used to monitor the continuing adequacy of the model.
Transfer function model filtering
In many time series applications it is desired to calculate the response (or output) of a transfer function (TF) model for a given input series.
Smoothing, detrending, and seasonal adjustment are typical applications. You must specify the orders and parameters of a TF model for the purpose being considered. This may then be applied to the input series.
Again, problems may arise due to ignorance of the input series values prior to the observation period. The transient errors which can arise from this may be substantially reduced by using ‘backforecasts’ of these unknown observations.
Multivariate Time Series
Multiinput modelling represents one output time series in terms of one or more input series. Although there are circumstances in which it may be more appropriate to analyse a set of time series by modelling each one in turn as the output series with the remainder as inputs, there is a more symmetric approach in such a context. These models are known as vector autoregressive movingaverage (VARMA) models.
Differencing and transforming a multivariate time series
As in the case of a univariate time series, it may be useful to simplify the series by differencing operations which may be used to remove linear or seasonal trends, thus ensuring that the resulting series to be used in the model estimation is stationary. It may also be necessary to apply transformations to the individual components of the multivariate series in order to stabilize the variance. Commonly used transformations are the log and square root transformations.
Model identification for a multivariate time series
Multivariate analogues of the autocorrelation and partial autocorrelation functions are available for analysing a set of k$k$ time series, x_{i,1},x_{i,2}, … ,x_{i,n}${x}_{\mathit{i},1},{x}_{\mathit{i},2},\dots ,{x}_{\mathit{i},n}$, for i = 1,2, … ,k$\mathit{i}=1,2,\dots ,k$, thereby making it possible to obtain some understanding of a suitable VARMA model for the observed series.
It is assumed that the time series have been differenced if necessary, and that they are jointly stationary. The lagged correlations between all possible pairs of series, i.e.,
are then taken to provide an adequate description of the statistical relationships between the series. These quantities are estimated by sample auto and crosscorrelations
r_{ijl}${r}_{ijl}$. For each
l$l$ these may be viewed as elements of a (lagged) autocorrelation matrix.
Thus consider the vector process x_{t}${x}_{t}$ (with elements x_{it}${x}_{it}$) and lagged autocovariance matrices Γ_{l}${\Gamma}_{l}$ with elements of σ_{i}σ_{j}ρ_{ijl}${\sigma}_{i}{\sigma}_{j}{\rho}_{ijl}$ where σ_{i}^{2} = var(x_{i,t})${\sigma}_{i}^{2}=\mathrm{var}\left({x}_{i,t}\right)$. Correspondingly, Γ_{l}${\Gamma}_{l}$ is estimated by the matrix C_{l}${C}_{l}$ with elements s_{i}s_{j}r_{ijl}${s}_{i}{s}_{j}{r}_{ijl}$ where s_{i}^{2}${s}_{i}^{2}$ is the sample variance of x_{it}${x}_{it}$.
For a series with shortterm crosscorrelation only, i.e., r_{ijl}${r}_{ijl}$ is not significant beyond some low lag q$q$, then the pure vector MA(q)$\text{MA}\left(q\right)$ model, with no autoregressive parameters, i.e., p = 0$p=0$, is appropriate.
The correlation matrices provide a description of the joint statistical properties of the series. It is also possible to calculate matrix quantities which are closely analogous to the partial autocorrelations of univariate series (see
Section [Partial autocorrelations]).
Wei (1990) discusses both the partial autoregression matrices proposed by
Tiao and Box (1981) and partial lag correlation matrices.
In the univariate case the partial autocorrelation function (PACF) between
x_{t}${x}_{t}$ and
x_{t + l}${x}_{t+l}$ is the correlation coefficient between the two after removing the linear dependence on each of the intervening variables
x_{t + 1},x_{t + 2}, … ,x_{t + l − 1}${x}_{t+1},{x}_{t+2},\dots ,{x}_{t+l1}$. This partial autocorrelation may also be obtained as the last regression coefficient associated with
x_{t}${x}_{t}$ when regressing
x_{t + l}${x}_{t+l}$ on its
l$l$ lagged variables
x_{t + l − 1},x_{t + l − 2}, … ,x_{t}${x}_{t+l1},{x}_{t+l2},\dots ,{x}_{t}$.
Tiao and Box (1981) extended this method to the multivariate case to define the partial autoregression matrix.
Heyse and Wei (1985) also extended the univariate definition of the PACF to derive the correlation matrix between the vectors
x_{t}${x}_{t}$ and
x_{t + l}${x}_{t+l}$ after removing the linear dependence on each of the intervening vectors
x_{t + 1},x_{t + 2}, … ,x_{t + l − 1}${x}_{t+1},{x}_{t+2},\dots ,{x}_{t+l1}$, the partial lag correlation matrix.
Note that the partial lag correlation matrix is a correlation coefficient matrix since each of its elements is a properly normalized correlation coefficient. This is not true of the partial autoregression matrices (except in the univariate case for which the two types of matrix are the same). The partial lag correlation matrix at lag 1$1$ also reduces to the regular correlation matrix at lag 1$1$; this is not true of the partial autoregression matrices (again except in the univariate case).
Both the above share the same cutoff property for autoregressive processes; that is for an autoregressive process of order p$p$, the terms of the matrix at lags p + 1$p+1$ and greater are zero. Thus if the sample partial crosscorrelations are significant only up to some low lag p$p$ then a pure vector AR(p)$\text{AR}\left(p\right)$ model is appropriate with q = 0$q=0$. Otherwise movingaverage terms will need to be introduced as well as autoregressive terms.
Under the hypothesis that x_{t}${x}_{t}$ is an autoregressive process of order l − 1$l1$, n$n$ times the sum of the squared elements of the partial lag correlation matrix at lag l$l$ is asymptotically distributed as a χ^{2}${\chi}^{2}$ variable with k^{2}${k}^{2}$ degrees of freedom where k$k$ is the dimension of the multivariate time series. This provides a diagnostic aid for determining the order of an autoregressive model.
The partial autoregression matrices may be found by solving a multivariate version of the Yule–Walker equations to find the autoregression matrices, using the final regression matrix coefficient as the partial autoregression matrix at that particular lag.
The basis of these calculations is a multivariate autoregressive model:
where
φ_{l,1},φ_{l,2}, … ,φ_{l,l}${\varphi}_{l,1},{\varphi}_{l,2},\dots ,{\varphi}_{l,l}$ are matrix coefficients, and
e_{l,t}${e}_{l,t}$ is the vector of errors in the prediction. These coefficients may be rapidly computed using a recursive technique which requires, and simultaneously furnishes, a backward prediction equation:
(in the univariate case
ψ_{l,i} = φ_{l,i}${\psi}_{l,i}={\varphi}_{l,i}$).
The forward prediction equation coefficients, φ_{l,i}${\varphi}_{l,i}$, are of direct interest, together with the covariance matrix D_{l}${D}_{l}$ of the prediction errors e_{l,t}${e}_{l,t}$. The calculation of these quantities for a particular maximum equation lag l = L$l=L$ involves calculation of the same quantities for increasing values of l = 1,2, … ,L$l=1,2,\dots ,L$.
The quantities
v_{l} = detD_{l} / detΓ_{0}${v}_{l}=\mathrm{det}{D}_{l}/\mathrm{det}{\Gamma}_{0}$ may be viewed as generalized variance ratios, and provide a measure of the efficiency of prediction (the smaller the better). The reduction from
v_{l − 1}${v}_{l1}$ to
v_{l}${v}_{l}$ which occurs on extending the order of the predictor to
l$l$ may be represented as
where
ρ_{l}^{2}${\rho}_{l}^{2}$ is a multiple squared partial autocorrelation coefficient associated with
k^{2}${k}^{2}$ degrees of freedom.
Sample estimates of all the above quantities may be derived by using the series covariance matrices
C_{l}${C}_{\mathit{l}}$, for
l = 1,2, … ,L$\mathit{l}=1,2,\dots ,L$, in place of
Γ_{l}${\Gamma}_{l}$. The best lag for prediction purposes may be chosen as that which yields the minimum final prediction error (FPE) criterion:
An alternative method of estimating the sample partial autoregression matrices is by using multivariate least squares to fit a series of multivariate autoregressive models of increasing order.
VARMA model estimation
The crosscorrelation structure of a stationary multivariate time series may often be represented by a model with a small number of parameters belonging to the VARMA class. If the stationary series
w_{t}${w}_{t}$ has been derived by transforming and/or differencing the original series
x_{t}${x}_{t}$, then
w_{t}${w}_{t}$ is said to follow the VARMA model:
where
ε_{t}${\epsilon}_{t}$ is a vector of uncorrelated residual series (white noise) with zero mean and constant covariance matrix
Σ$\Sigma $,
φ_{1},φ_{2}, … ,φ_{p}${\varphi}_{1},{\varphi}_{2},\dots ,{\varphi}_{p}$ are the
p$p$ autoregressive (AR) parameter matrices and
θ_{1},θ_{2}, … ,θ_{q}${\theta}_{1},{\theta}_{2},\dots ,{\theta}_{q}$ are the
q$q$ movingaverage (MA) parameter matrices. If
w_{t}${w}_{t}$ has a nonzero mean
μ$\mu $, then this can be allowed for by replacing
w_{t},w_{t − 1}, … ${w}_{t},{w}_{t1},\dots \text{}$ by
w_{t} − μ,w_{t − 1} − μ, … ${w}_{t}\mu ,{w}_{t1}\mu ,\dots \text{}$ in the model.
A series generated by this model will only be stationary provided restrictions are placed on
φ_{1},φ_{2}, … ,φ_{p}${\varphi}_{1},{\varphi}_{2},\dots ,{\varphi}_{p}$ to avoid unstable growth of
w_{t}${w}_{t}$. These are stationarity constraints. The series
ε_{t}${\epsilon}_{t}$ may also be usefully interpreted as the linear innovations in
w_{t}${w}_{t}$, i.e., the error if
w_{t}${w}_{t}$ were to be predicted using the information in all past values
w_{t − 1},w_{t − 2}, … ${w}_{t1},{w}_{t2},\dots \text{}$, provided also that
θ_{1},θ_{2}, … ,θ_{q}${\theta}_{1},{\theta}_{2},\dots ,{\theta}_{q}$ satisfy what are known as invertibility constraints. This allows the series
ε_{t}${\epsilon}_{t}$ to be generated by rewriting the model equation as
The method of maximum likelihood (ML) may be used to estimate the parameters of a specified VARMA model from the observed multivariate time series together with their standard errors and correlations.
The residuals from the model may be examined for the presence of autocorrelations as a check on the adequacy of the fitted model.
VARMA model forecasting
Forecasts of the series may be constructed using a multivariate version of the univariate method. Efficient methods are available for updating the forecasts each time new observations become available.
Crossspectral Analysis
The relationship between two time series may be investigated in terms of their sinusoidal components at different frequencies. At frequency
ω$\omega $ a component of
y_{t}${y}_{t}$ of the form
has its amplitude
R_{y}(ω)${R}_{y}\left(\omega \right)$ and phase lag
φ_{y}(ω)${\varphi}_{y}\left(\omega \right)$ estimated by
and similarly for
x_{t}${x}_{t}$. In the univariate analysis only the amplitude was important – in the cross analysis the phase is important.
The sample crossspectrum
This is defined by
It may be demonstrated that this is equivalently defined in terms of the sample crosscorrelation function (CCF),
r_{xy}(k)${r}_{xy}\left(k\right)$, of the series as
where
c_{xy}(k) = s_{x}s_{y}r_{xy}(k)${c}_{xy}\left(k\right)={s}_{x}{s}_{y}{r}_{xy}\left(k\right)$ is the crosscovariance function.
The amplitude and phase spectrum
The crossspectrum is specified by its real part or cospectrum
cf^{*}(ω)$c{f}^{*}\left(\omega \right)$ and imaginary part or quadrature spectrum
qf^{*}(ω)$q{f}^{*}\left(\omega \right)$, but for the purpose of interpretation the crossamplitude spectrum and phase spectrum are useful:
If the series
x_{t}${x}_{t}$ and
y_{t}${y}_{t}$ contain deterministic sinusoidal components of amplitudes
R_{y},R_{x}${R}_{y},{R}_{x}$ and phases
φ_{y},φ_{x}${\varphi}_{y},{\varphi}_{x}$ at frequency
ω$\omega $, then
A^{*}(ω)${A}^{*}\left(\omega \right)$ will have a peak of approximate width
π / n$\pi /n$ and height
(n / 2π)R_{y}R_{x}$(n/2\pi ){R}_{y}{R}_{x}$ at that frequency, with corresponding phase
φ^{*}(ω) = φ_{y} − φ_{x}${\varphi}^{*}\left(\omega \right)={\varphi}_{y}{\varphi}_{x}$. This supplies no information that cannot be obtained from the two series separately. The statistical relationship between the series is better revealed when the series are purely stochastic and jointly stationary, in which case the expected value of
f_{xy}^{ * }(ω)${f}_{xy}^{*}\left(\omega \right)$ converges with increasing sample size to the theoretical crossspectrum
where
γ_{xy}(k) = cov(x_{t},y_{t + k})${\gamma}_{xy}\left(k\right)=\mathrm{cov}({x}_{t},{y}_{t+k})$. The sample spectrum, as in the univariate case, does not converge to the theoretical spectrum without some form of smoothing which either implicitly (using a lag window) or explicitly (using a frequency window) averages the sample spectrum
f_{xy(ω)}^{ * }${f}_{xy\left(\omega \right)}^{*}$ over wider bands of frequency to obtain a smoothed estimate
f̂_{xy}(ω)${\hat{f}}_{xy}\left(\omega \right)$.
The coherency spectrum
If there is no statistical relationship between the series at a given frequency, then
f_{xy}(ω) = 0${f}_{xy}\left(\omega \right)=0$, and the smoothed estimate
f̂_{xy}(ω)${\hat{f}}_{xy}\left(\omega \right)$, will be close to
0$0$. This is assessed by the squared coherency between the series:
where
f̂_{xx}(ω)${\hat{f}}_{xx}\left(\omega \right)$ is the corresponding smoothed univariate spectrum estimate for
x_{t}${x}_{t}$, and similarly for
y_{t}${y}_{t}$. The coherency can be treated as a squared multiple correlation. It is similarly invariant in theory not only to simple scaling of
x_{t}${x}_{t}$ and
y_{t}${y}_{t}$, but also to filtering of the two series, and provides a useful test statistic for the relationship between autocorrelated series. Note that without smoothing,
so the coherency is
1$1$ at all frequencies, just as a correlation is
1$1$ for a sample of size
1$1$. Thus smoothing is essential for crossspectrum analysis.
The gain and noise spectrum
If
y_{t}${y}_{t}$ is believed to be related to
x_{t}${x}_{t}$ by a linear lagged relationship as in
Section [Linear Lagged Relationships Between Time Series], i.e.,
then the theoretical crossspectrum is
where
is called the frequency response of the relationship.
Thus if
x_{t}${x}_{t}$ were a sinusoidal wave at frequency
ω$\omega $ (and
n_{t}${n}_{t}$ were absent),
y_{t}${y}_{t}$ would be similar but multiplied in amplitude by
G(ω)$G\left(\omega \right)$ and shifted in phase by
φ(ω)$\varphi \left(\omega \right)$. Furthermore, the theoretical univariate spectrum
where
n_{t}${n}_{t}$, with spectrum
f_{n}(ω)${f}_{n}\left(\omega \right)$, is assumed independent of the input
x_{t}${x}_{t}$.
Crossspectral analysis thus furnishes estimates of the gain
and the phase
From these representations of the estimated frequency response
V̂(ω)$\hat{V}\left(\omega \right)$, parametric transfer function (TF) models may be recognized and selected. The noise spectrum may also be estimated as
a formula which reflects the fact that in essence a regression is being performed of the sinusoidal components of
y_{t}${y}_{t}$ on those of
x_{t}${x}_{t}$ over each frequency band.
Interpretation of the frequency response may be aided by extracting from V̂(ω)$\hat{V}\left(\omega \right)$ estimates of the impulse response function (IRF) v̂_{k}${\hat{v}}_{k}$. It is assumed that there is no anticipatory response between y_{t}${y}_{t}$ and x_{t}${x}_{t}$, i.e., no coefficients v_{k}${v}_{k}$ with k = − 1$k=1$ or − 2$2$ are needed (their presence might indicate feedback between the series).
Crossspectrum smoothing by lag window
The estimate of the crossspectrum is calculated from the sample crossvariances as
The lag window
w_{k}${w}_{k}$ extends up to a truncation lag
M$M$ as in the univariate case, but its centre is shifted by an alignment lag
S$S$ usually chosen to coincide with the peak crosscorrelation. This is equivalent to an alignment of the series for peak crosscorrelation at lag
0$0$, and reduces bias in the phase estimation.
The selection of the truncation lag M$M$, which fixes the bandwidth of the estimate, is based on the same criteria as for univariate series, and the same choice of M$M$ and window shape should be used as in univariate spectrum estimation to obtain valid estimates of the coherency, gain, etc., and test statistics.
Direct smoothing of the crossspectrum
The computations are exactly as for smoothing of the univariate spectrum except that allowance is made for an implicit alignment shift S$S$ between the series.
Kalman Filters
Kalman filtering provides a method for the analysis of multidimensional time series. The underlying model is:
where
X_{t}${X}_{t}$ is the unobserved state vector,
Y_{t}${Y}_{t}$ is the observed measurement vector,
W_{t}${W}_{t}$ is the state noise,
V_{t}${V}_{t}$ is the measurement noise,
A_{t}${A}_{t}$ is the state transition matrix,
B_{t}${B}_{t}$ is the noise coefficient matrix and
C_{t}${C}_{t}$ is the measurement coefficient matrix at time
t$t$. The state noise and the measurement noise are assumed to be uncorrelated with zero mean and covariance matrices:
If the system matrices
A_{t}${A}_{t}$,
B_{t}${B}_{t}$,
C_{t}${C}_{t}$ and the covariance matrices
Q_{t},R_{t}${Q}_{t},{R}_{t}$ are known then Kalman filtering can be used to compute the minimum variance estimate of the stochastic variable
X_{t}${X}_{t}$.
The estimate of X_{t}${X}_{t}$ given observations Y_{1}${Y}_{1}$ to Y_{t − 1}${Y}_{t1}$ is denoted by
X̂_{t ∣ t − 1}
${\hat{X}}_{t\mid t1}$ with state covariance matrix
E
{X̂_{t ∣ t − 1}X̂_{t ∣ t − 1}^{T}} =
P_{t ∣ t − 1}$E\left\{{\hat{X}}_{t\mid t1}{\hat{X}}_{t\mid t1}^{\mathrm{T}}\right\}={P}_{t\mid t1}$ while the estimate of X_{t}${X}_{t}$ given observations Y_{1}${Y}_{1}$ to Y_{t}${Y}_{t}$ is denoted by
X̂_{t ∣ t}
${\hat{X}}_{t\mid t}$ with covariance matrix
E
{X̂_{t ∣ t}X̂_{t ∣ t}^{T}} =
P_{t ∣ t}$E\left\{{\hat{X}}_{t\mid t}{\hat{X}}_{t\mid t}^{\mathrm{T}}\right\}={P}_{t\mid t}$.
The update of the estimate,
X̂_{t + 1 ∣ t}
${\hat{X}}_{t+1\mid t}$, from time t$t$ to time t + 1$t+1$, is computed in two stages.
First, the update equations are
where the residual
r_{t} =
Y_{t} −
C_{t}
X_{t ∣ t − 1}
${r}_{t}={Y}_{t}{C}_{t}{X}_{t\mid t1}$ has an associated covariance matrix
H_{t}
=
C_{t}
P_{t ∣ t − 1}
C_{t}^{T}
+
R_{t}
${H}_{t}={C}_{t}{P}_{t\mid t1}{C}_{t}^{\mathrm{T}}+{R}_{t}$, and
K_{t}${K}_{t}$ is the Kalman gain matrix with
The second stage is the onestepahead prediction equations given by
These two stages can be combined to give the onestepahead updateprediction equations
The above equations thus provide a method for recursively calculating the estimates of the state vectors
X̂_{t ∣ t}
${\hat{X}}_{t\mid t}$ and
X̂_{t + 1 ∣ t}
${\hat{X}}_{t+1\mid t}$ and their covariance matrices
P_{t ∣ t}
${P}_{t\mid t}$ and
P_{t + 1 ∣ t}${P}_{t+1\mid t}$ from their previous values. This recursive procedure can be viewed in a Bayesian framework as being the updating of the prior by the data
Y_{t}${Y}_{t}$.
The initial values
X̂_{1 ∣ 0}${\hat{X}}_{1\mid 0}$ and
P_{1 ∣ 0}${P}_{1\mid 0}$ are required to start the recursion. For stationary systems,
P_{1 ∣ 0}${P}_{1\mid 0}$ can be computed from the following equation:
which can be solved by iterating on the equation. For
X̂_{1 ∣ 0}${\hat{X}}_{1\mid 0}$ the value
E{X}$E\left\{X\right\}$ can be used if it is available.
Computational methods
To improve the stability of the computations the square root algorithm is used. One recursion of the square root covariance filter algorithm which can be summarised as follows:
where
U$U$ is an orthogonal transformation triangularizing the lefthand prearray to produce the righthand postarray,
S_{t}${S}_{t}$ is the lower triangular Cholesky factor of the state covariance matrix
P_{t + 1 ∣ t}${P}_{t+1\mid t}$,
Q_{t}^{1 / 2}${Q}_{t}^{1/2}$ and
R_{t}^{1 / 2}${R}_{t}^{1/2}$ are the lower triangular Cholesky factor of the covariance matrices
Q$Q$ and
R$R$ and
H^{1 / 2}${H}^{1/2}$ is the lower triangular Cholesky factor of the covariance matrix of the residuals. The relationship between the Kalman gain matrix,
K_{t}${K}_{t}$, and
G_{t}${G}_{t}$ is given by
To improve the efficiency of the computations when the matrices
A_{t},B_{t}${A}_{t},{B}_{t}$ and
C_{t}${C}_{t}$ do not vary with time the system can be transformed to give a simpler structure. The transformed state vector is
U^{*}X${U}^{*}X$ where
U^{*}${U}^{*}$ is the transformation that reduces the matrix pair
(A,C)$(A,C)$ to lower observer Hessenberg form. That is, the matrix
U^{*}${U}^{*}$ is computed such that the compound matrix
is a lower trapezoidal matrix. The transformations need only be computed once at the start of a series, and the covariance matrices
Q_{t}${Q}_{t}$ and
R_{t}${R}_{t}$ can still be timevarying.
Model fitting and forecasting
If the state space model contains unknown parameters,
θ$\theta $, these can be estimated using maximum likelihood (ML). Assuming that
W_{t}${W}_{t}$ and
V_{t}${V}_{t}$ are normal variates the loglikelihood for observations
Y_{t}${Y}_{\mathit{t}}$, for
t = 1,2, … ,n$\mathit{t}=1,2,\dots ,n$, is given by
Optimal estimates for the unknown model parameters
θ$\theta $ can then be obtained by using a suitable optimizer function to maximize the likelihood function.
Once the model has been fitted forecasting can be performed by using the onestepahead prediction equations. The onestepahead prediction equations can also be used to ‘jump over’ any missing values in the series.
Kalman filter and time series models
Many commonly used time series models can be written as state space models. A univariate
ARMA(p,q)$\mathrm{ARMA}(p,q)$ model can be cast into the following state space form:
where
r = max (p,q + 1)$r=\mathrm{max}\phantom{\rule{0.125em}{0ex}}(p,q+1)$.
The representation for a k$k$variate ARMA(p,q)$\mathrm{ARMA}(p,q)$ series (VARMA) is very similar to that given above, except now the state vector is of length kr$kr$ and the φ$\varphi $ and θ$\theta $ are now k × k$k\times k$ matrices and the 1s in A$A$, B$B$ and C$C$ are now the identity matrix of order k$k$. If p < r$p<r$ or q + 1 < r$q+1<r$ then the appropriate φ$\varphi $ or θ$\theta $ matrices are set to zero, respectively.
Since the compound matrix
is already in lower observer Hessenberg form (i.e., it is lower trapezoidal with zeros in the top righthand triangle) the invariant Kalman filter algorithm can be used directly without the need to generate a transformation matrix
U^{*}${U}^{*}$.
GARCH Models
ARCH models and their generalizations
Rather than modelling the mean (for example using regression models) or the autocorrelation (by using ARMA models) there are circumstances in which the variance of a time series needs to be modelled. This is common in financial data modelling where the variance (or standard deviation) is known as volatility. The ability to forecast volatility is a vital part in deciding the risk attached to financial decisions like portfolio selection. The basic model for relating the variance at time
t$t$ to the variance at previous times is the autoregressive conditional heteroskedastic (ARCH) model. The standard ARCH model is defined as
where
ψ_{t}${\psi}_{t}$ is the information up to time
t$t$ and
h_{t}${h}_{t}$ is the conditional variance.
In a similar way to that in which autoregressive (AR) models were generalized to ARMA models the ARCH models have been generalized to a GARCH model; see
Engle (1982),
Bollerslev (1986) and
Hamilton (1994)This can be combined with a regression model:
where
ε_{t} ∣ ψ_{t − 1} ∼ N(0,h_{t})${\epsilon}_{t}\mid {\psi}_{t1}\sim N(0,{h}_{t})$ and where
x_{it}${x}_{\mathit{i}t}$, for
i = 1,2, … ,k$\mathit{i}=1,2,\dots ,k$, are the exogenous variables.
The above models assume that the change in variance, h_{t}${h}_{t}$, is symmetric with respect to the shocks, that is, that a large negative value of ε_{t − 1}${\epsilon}_{t1}$ has the same effect as a large positive value of ε_{t − 1}${\epsilon}_{t1}$. A frequently observed effect is that a large negative value ε_{t − 1}${\epsilon}_{t1}$ often leads to a greater variance than a large positive value. The following three asymmetric models represent this effect in different ways using the parameter γ$\gamma $ as a measure of the asymmetry.
GJRGARCH(
p,q$p,q$), or Glosten, Jagannathan and Runkle GARCH (see
Glosten et al. (1993))
where
I_{t} = 1${I}_{t}=1$ if
ε_{t} < 0${\epsilon}_{t}<0$ and
I_{t} = 0${I}_{t}=0$ if
ε_{t} ≥ 0${\epsilon}_{t}\ge 0$.
The first assumes that the effects of the shocks are symmetric about
γ$\gamma $ rather than zero, so that for
γ < 0$\gamma <0$ the effect of negative shocks is increased and the effect of positive shocks is decreased. Both the Type II AGARCH and the GJR GARCH (see
Glosten et al. (1993)) models introduce asymmetry by increasing the value of the coefficient of
ε_{t − 1}^{2}${\epsilon}_{t1}^{2}$ for negative values of
ε_{t − 1}${\epsilon}_{t1}$. In the case of the Type II AGARCH the effect is multiplicative while for the GJR GARCH the effect is additive.
Coefficient 
ε_{t − 1} < 0${\epsilon}_{t1}<0$ 
ε_{t − 1} > 0${\epsilon}_{t1}>0$ 
Type II AGARCH 
α_{i}(1 − γ)^{2}${\alpha}_{i}{(1\gamma )}^{2}$ 
α_{i}(1 + γ)^{2}${\alpha}_{i}{(1+\gamma )}^{2}$ 
GJR GARCH 
α_{i} + γ${\alpha}_{i}+\gamma $ 
α_{i}${\alpha}_{i}$ 
(Note that in the case of GJR GARCH, γ$\gamma $ needs to be positive to inflate variance after negative shocks while for Type I and Type II AGARCH, γ$\gamma $ needs to be negative.)
A third type of GARCH model is the exponential GARCH (EGARCH). In this model the variance relationship is on the log scale and hence asymmetric.
where
z_{t} = (ε_{t})/(sqrt(h_{t}))
${z}_{t}=\frac{{\epsilon}_{t}}{\sqrt{{h}_{t}}}$ and
E[z_{t − i}]$E\left[\left{z}_{ti}\right\right]$ denotes the expected value of
z_{t − i}$\left{z}_{ti}\right$.
Note that the φ_{i}${\varphi}_{i}$ terms represent a symmetric contribution to the variance while the α_{i}${\alpha}_{i}$ terms give an asymmetric contribution.
Another common characteristic of financial data is that it is heavier in the tails (leptokurtic) than the Normal distribution. To model this the Normal distribution is replaced by a scaled Student's t$t$distribution (that is a Student's t$t$distribution standardized to have variance h_{t}${h}_{t}$). The Student's t$t$distribution is such that the smaller the degrees of freedom the higher the kurtosis for degrees of freedom > 4$\text{}>4$.
Fitting GARCH models
The models are fitted by maximizing the conditional loglikelihood. For the Normal distribution the conditional loglikelihood is
For the Student's t$t$distribution the function is more complex. An approximation to the standard errors of the parameter estimates is computed from the Fisher information matrix.
Inhomogeneous Time Series
If we denote a generic univariate time series as a sequence of pairs of values (z_{i},t_{i})$({z}_{\mathit{i}},{t}_{\mathit{i}})$, for i = 1,2, … $\mathit{i}=1,2,\dots $ where the z$z$'s represent an observed scalar value and the t$t$'s the time that the value was observed, then in a standard time series analysis, as discussed in other sections of this introduction, it is assumed that the series being analysed is homogeneous, that is the sampling times are regularly spaced with t_{i} − t_{i − 1} = δ${t}_{i}{t}_{i1}=\delta $ for some value δ$\delta $. In many real world applications this assumption does not hold, that is, the series is inhomogeneous.
Standard time series analysis techniques cannot be used on an inhomogeneous series without first preprocessing the series to construct an artificial homogeneous series, by for example, resampling the series at regular intervals.
Zumbach and Müller (2001) introduced a series of operators that can be used to extract robust information directly from the inhomogeneous time series. In this context, robust information means that the results should be essentially independent of minor changes to the sampling mechanism used when collecting the data, for example, changing a number of time stamps or adding or removing a few observations.
The basic operator available for inhomogeneous time series is the exponential moving average (EMA). This operator has a single parameter,
τ$\tau $, and is an average operator with an exponentially decaying kernel given by:
This gives rise to the following iterative formula:
where
The value of
ν$\nu $ depends on the method of interpolation chosen. Three interpolation methods are available:
1. 
Previous point: 
ν = 1$\nu =1$. 
2. 
Linear: 
ν =
(1 − μ)
/
α
$\nu =(1\mu )/\alpha $. 
3. 
Next point: 
ν = μ$\nu =\mu $. 
Given the EMA, a number of other operators can be defined, including:
(i) 
m$\mathbf{m}$Iterated Exponential Moving Average, defined as

(ii) 
Moving Average (MA), defined as

(iii) 
Moving Norm (MNorm), defined as

(iv) 
Moving Variance (MVar), defined as

(v) 
Moving Standard Deviation (MSD), defined as

(vi) 
Differential ( Δ$\mathbf{\Delta}$), defined as

(vii) 
Volatility, defined as

A discussion of each of these operators, their use and in some cases, alternative definitions, are given in
Zumbach and Müller (2001).
Recommendations on Choice and Use of Available Functions
ARMAtype Models
ARMAtype modelling usually follows the methodology made popular by Box and Jenkins. It consists of four steps: identification, model fitting, model checking and forecasting. The availability of functions for each of these four steps is given below for the three types of modelling situation considered: univariate, inputoutput and multivariate.
Univariate series
(a) 
Model identification
The function nag_tsa_uni_means (g13au) may be used in obtaining either a rangemean or standard deviationmean plot for a series of observations, which may be useful in detecting the need for a variancestabilizing transformation. nag_tsa_uni_means (g13au) computes the range or standard deviation and the mean for successive groups of observations
and nag_stat_plot_scatter_2var (g01ag)
may then be used to produce a scatter plot of range against mean or of standard deviation against mean.
The function nag_tsa_uni_diff (g13aa) may be used to difference a time series. The N = n − d − s × D$N=nds\times D$ values of the differenced time series which extends for t = 1 + d + s × D, … ,n$t=1+d+s\times D,\dots ,n$ are stored in the first N$N$ elements of the output array.
The function nag_tsa_uni_autocorr (g13ab) may be used for direct computation of the autocorrelations. It requires the time series as input, after optional differencing by nag_tsa_uni_diff (g13aa).
An alternative is to use nag_tsa_uni_spectrum_lag (g13ca), which uses the fast Fourier transform (FFT) to carry out the convolution for computing the autocovariances. Circumstances in which this is recommended are
(i) 
if the main aim is to calculate the smoothed sample spectrum; 
(ii) 
if the series length and maximum lag for the autocorrelations are both very large, in which case appreciable computing time may be saved. 
For more precise recommendations, see Gentleman and Sande (1966). In this case the autocorrelations r_{k}${r}_{k}$ need to be obtained from the autocovariances c_{k}${c}_{k}$ by r_{k} = c_{k} / c_{0}${r}_{k}={c}_{k}/{c}_{0}$.
The function nag_tsa_uni_autocorr_part (g13ac) computes the partial autocorrelation function (PACF) and prediction error variance estimates from an input autocorrelation function (ACF). Note that nag_tsa_multi_corrmat_partlag (g13dn), which is designed for multivariate time series, may also be used to compute the PACF together with χ^{2}${\chi}^{2}$ statistics and their significance levels.
Finite lag predictor coefficients are also computed by the function nag_tsa_uni_autocorr_part (g13ac). It may have to be used twice, firstly with a large value for the maximum lag L$L$ in order to locate the optimum final prediction error (FPE) lag, then again with L$L$ reset to this lag.
The function nag_tsa_uni_arma_roots (g13dx) may be used to check that the autoregressive (AR) part of the model is stationary and that the movingaverage (MA) part is invertible. 
(b) 
Model estimation
The function nag_tsa_uni_arima_prelim (g13ad) is used to compute preliminary estimates of the ARIMA model parameters, the sample autocorrelations of the appropriately differenced series being input. The model orders are required.
The main function for parameter estimation for ARIMA models is nag_tsa_uni_arima_estim (g13ae), and an easytouse version is nag_tsa_uni_arima_estim_easy (g13af). Both these functions use the least squares criterion of estimation.
In some circumstances the use of
nag_tsa_multi_inputmod_estim (g13be) or nag_tsa_multi_varma_estimate (g13dd),
which use maximum likelihood (ML), is recommended.
The functions require the time series values to be input, together with the ARIMA orders. Any differencing implied by the model is carried out internally. They also require the maximum number of iterations to be specified, and return the state set for use in forecasting.
nag_tsa_uni_arima_estim (g13ae) should be preferred to nag_tsa_uni_arima_estim_easy (g13af) for:
(i) 
more information about the differenced series, its backforecasts and the intermediate series; 
(ii) 
greater control over the output at successive iterations; 
(iii) 
more detailed control over the search policy of the nonlinear least squares algorithm; 
(iv) 
more information about the first and second derivatives of the objective function during and upon completion of the iterations. 
nag_tsa_multi_inputmod_estim (g13be) is primarily designed for estimating relationships between time series. It is, however, easily used in a univariate mode for ARIMA model estimation. The advantage is that it allows (optional) use of the exact likelihood estimation criterion, which is not available in nag_tsa_uni_arima_estim (g13ae) or nag_tsa_uni_arima_estim_easy (g13af). This is particularly recommended for models which have seasonal parameters, because it reduces the tendency of parameter estimates to become stuck at points on the parameter space boundary. The model parameters estimated in this function should be passed over to nag_tsa_uni_arima_forcecast (g13aj) for use in univariate forecasting. The function nag_tsa_multi_varma_estimate (g13dd) is primarily designed for fitting vector ARMA models to multivariate time series but may also be used in a univariate mode. It allows the use of either the exact or conditional likelihood estimation criterion, and allows you to fit nonmultiplicative seasonal models which are not available in
nag_tsa_uni_arima_estim (g13ae), nag_tsa_uni_arima_estim_easy (g13af) or nag_tsa_multi_inputmod_estim (g13be).

(c) 
Model checking
nag_tsa_uni_arima_resid (g13as) calculates the correlations in the residuals from a model fitted by either nag_tsa_uni_arima_estim (g13ae) or nag_tsa_uni_arima_estim_easy (g13af). In addition the standard errors and correlations of the residual autocorrelations are computed along with a portmanteau test for model adequacy.
nag_tsa_uni_arima_resid (g13as) can be used after a univariate model has been fitted by nag_tsa_multi_inputmod_estim (g13be), but care must be taken in selecting the correct inputs to nag_tsa_uni_arima_resid (g13as). Note that if nag_tsa_multi_varma_estimate (g13dd) has been used to fit a nonmultiplicative seasonal model to a univariate series then nag_tsa_multi_varma_diag (g13ds) may be used to check the adequacy of the model.

(d) 
Forecasting using an ARIMA model
Given that the state set produced on estimation of the ARIMA model by either nag_tsa_uni_arima_estim (g13ae) or nag_tsa_uni_arima_estim_easy (g13af) has been retained, nag_tsa_uni_arima_forecast_state (g13ah) can be used directly to construct forecasts for x_{n + 1},x_{n + 2}, … ${x}_{n+1},{x}_{n+2},\dots \text{}$, together with probability limits.
If some further observations x_{n + 1},x_{n + 2}, … ${x}_{n+1},{x}_{n+2},\dots \text{}$ have come to hand since model estimation (and there is no desire to reestimate the model using the extended series), then
nag_tsa_uni_arima_update (g13ag)
can be used to update the state set using the new observations, prior to forecasting from the end of the extended series. The original series is not required.
The function nag_tsa_uni_arima_forcecast (g13aj) is provided for forecasting when the ARIMA model is known but the state set is unknown. For example, the model may have been estimated by a procedure other than the use of nag_tsa_uni_arima_estim (g13ae) or nag_tsa_uni_arima_estim_easy (g13af), such as nag_tsa_multi_inputmod_estim (g13be). nag_tsa_uni_arima_forcecast (g13aj) constructs the state set and optionally constructs forecasts with probability limits. It is equivalent to a call to nag_tsa_uni_arima_estim (g13ae) with zero iterations requested, followed by an optional call to nag_tsa_uni_arima_forecast_state (g13ah), but it is much more efficient. 
Inputoutput/transfer function modelling
(a) 
Model identification
Normally use nag_tsa_multi_xcorr (g13bc) for direct computation of crosscorrelations, from which crosscovariances may be obtained by multiplying by s_{y}s_{x}${s}_{y}{s}_{x}$, and impulse response estimates (after prewhitening) by multiplying by s_{y} / s_{x}${s}_{y}/{s}_{x}$, where s_{y},s_{x}${s}_{y},{s}_{x}$ are the sample standard deviations of the series.
An alternative is to use nag_tsa_multi_spectrum_lag (g13cc), which exploits the fast Fourier transform (FFT) to carry out the convolution for computing crosscovariances. The criteria for this are the same as given in Section [Univariate series] for calculation of autocorrelations. The impulse response function may also be computed by spectral methods without prewhitening using nag_tsa_multi_noise_bivar (g13cg).
nag_tsa_multi_filter_arima (g13ba) may be used to prewhiten or filter a series by an ARIMA model.
nag_tsa_multi_filter_transf (g13bb) may be used to filter a time series using a transfer function model. 
(b) 
Estimation of
inputoutput
model parameters
The function nag_tsa_multi_transf_prelim (g13bd) is used to obtain preliminary estimates of transfer function model parameters. The model orders and an estimate of the impulse response function (see Section [Univariate spectral estimation]) are required.
The simultaneous estimation of the transfer function model parameters for the inputs, and ARIMA model parameters for the output, is carried out by nag_tsa_multi_inputmod_estim (g13be).
This function requires values of the output and input series, and the orders of all the models. Any differencing implied by the model is carried out internally.
The function also requires the maximum number of iterations to be specified, and returns the state set for use in forecasting. 
(c) 
Inputoutput
model checking
The function nag_tsa_uni_arima_resid (g13as), primarily designed for univariate time series, can be used to test the residuals from an inputoutput model. 
(d) 
Forecasting using
an inputoutput
model
Given that the state set produced on estimation of the model by nag_tsa_multi_inputmod_estim (g13be) has been retained, the function nag_tsa_multi_inputmod_forecast_state (g13bh) can be used directly to construct forecasts of the output series. Future values of the input series (possibly forecasts previously obtained using nag_tsa_uni_arima_forecast_state (g13ah)) are required.
If further observations of the output and input series have become available since model estimation (and there is no desire to reestimate the model using the extended series) then nag_tsa_multi_inputmod_update (g13bg) can be used to update the state set using the new observations prior to forecasting from the end of the extended series. The original series are not required.
The function nag_tsa_multi_inputmod_forecast (g13bj) is provided for forecasting when the multiinput model is known, but the state set is unknown. The set of output and input series must be supplied to the function which then constructs the state set (for future use with nag_tsa_multi_inputmod_update (g13bg) and/or nag_tsa_multi_inputmod_forecast_state (g13bh)) and also optionally constructs forecasts of the output series in a similar manner to nag_tsa_multi_inputmod_forecast_state (g13bh).
In constructing probability limits for the forecasts, it is possible to allow for the fact that future input series values may themselves have been calculated as forecasts using ARIMA models. Use of this option requires that these ARIMA models be supplied to the function. 
(e) 
Filtering a time series using a transfer function model

Multivariate series
(a) 
Model identification
The function nag_tsa_multi_diff (g13dl) may be used to difference the series. You must supply the differencing parameters for each component of the multivariate series. The order of differencing for each individual component does not have to be the same. The function may also be used to apply a log or square root transformation to the components of the series.
The function nag_tsa_multi_corrmat_cross (g13dm) may be used to calculate the sample crosscorrelation or crosscovariance matrices. It requires a set of time series as input. You may request either the crosscovariances or crosscorrelations.
The function nag_tsa_multi_corrmat_partlag (g13dn) computes the partial lag correlation matrices from the sample crosscorrelation matrices computed by nag_tsa_multi_corrmat_cross (g13dm), and the function nag_tsa_multi_regmat_partial (g13dp) computes the least squares estimates of the partial autoregression matrices and their standard errors. Both functions compute a series of χ^{2}${\chi}^{2}$ statistics that aid the determination of the order of a suitable autoregressive model. nag_tsa_multi_autocorr_part (g13db) may also be used in the identification of the order of an autoregressive model. The function computes multiple squared partial autocorrelations and predictive error variance ratios from the sample crosscorrelations or crosscovariances computed by nag_tsa_multi_corrmat_cross (g13dm).
The function nag_tsa_uni_arma_roots (g13dx) may be used to check that the autoregressive part of the model is stationary and that the movingaverage part is invertible. 
(b) 
Estimation of VARMA model parameters
The function for this purpose is nag_tsa_multi_varma_estimate (g13dd). This function requires a set of time series to be input, together with values for p$p$ and q$q$. You must also specify the maximum number of likelihood evaluations to be permitted and which parameters (if any) are to be held at their initial (usersupplied) values. The fitting criterion is either exact maximum likelihood (ML) or conditional maximum likelihood.
nag_tsa_multi_varma_estimate (g13dd) is primarily designed for estimating relationships between time series. It may, however, easily be used in univariate mode for nonseasonal and nonmultiplicative seasonal ARIMA model estimation. The advantage is that it allows (optional) use of the exact maximum likelihood (ML) estimation criterion, which is not available in
either nag_tsa_uni_arima_estim (g13ae) or nag_tsa_uni_arima_estim_easy (g13af).
The conditional likelihood option is recommended for those models in which the parameter estimates display a tendency to become stuck at points on the boundary of the parameter space. When one of the series is known to be influenced by all the others, but the others in turn are mutually independent and do not influence the output series, then nag_tsa_multi_inputmod_estim (g13be) (the transfer function (TF) model fitting function) may be more appropriate to use. 
(c) 
VARMA model checking
nag_tsa_multi_varma_diag (g13ds) calculates the crosscorrelation matrices of residuals for a model fitted by nag_tsa_multi_varma_estimate (g13dd). In addition the standard errors and correlations of the residual correlation matrices are computed along with a portmanteau test for model adequacy. 
(d) 
Forecasting using a VARMA model
The function nag_tsa_multi_varma_forecast (g13dj) may be used to construct a chosen number of forecasts using the model estimated by nag_tsa_multi_varma_estimate (g13dd). The standard errors of the forecasts are also computed. A reference vector is set up by nag_tsa_multi_varma_forecast (g13dj) so that should any further observations become available the existing forecasts can be efficiently updated using nag_tsa_multi_varma_update (g13dk). On a call to nag_tsa_multi_varma_update (g13dk) the reference vector itself is also updated so that nag_tsa_multi_varma_update (g13dk) may be called again each time new observations are available. 
Exponential Smoothing
A variety of different smoothing methods are provided by
nag_tsa_uni_smooth_exp (g13am), including; single exponential, Brown's double exponential, linear Holt (also called double exponential smoothing in some references), additive Holt–Winters and multiplicative Holt–Winters. The choice of smoothing method used depends on the characteristics of the time series. If the mean of the series is only slowly changing then single exponential smoothing may be suitable. If there is a trend in the time series, which itself may be slowly changing, then double exponential smoothing may be suitable. If there is a seasonal component to the time series, e.g., daily or monthly data, then one of the two Holt–Winters methods may be suitable.
Spectral Methods
Univariate spectral estimation
Two functions are available,
nag_tsa_uni_spectrum_lag (g13ca) carrying out smoothing using a lag window and
nag_tsa_uni_spectrum_daniell (g13cb) carrying out direct frequency domain smoothing. Both can take as input the original series, but
nag_tsa_uni_spectrum_lag (g13ca) alone can use the sample autocovariances as alternative input. This has some computational advantage if a variety of spectral estimates needs to be examined for the same series using different amounts of smoothing.
However, the real choice in most cases will be which of the four shapes of lag window in
nag_tsa_uni_spectrum_lag (g13ca) to use, or whether to use the trapezium frequency window of
nag_tsa_uni_spectrum_daniell (g13cb). The references may be consulted for advice on this, but the two most recommended lag windows are the Tukey and Parzen. The Tukey window has a very small risk of supplying negative spectrum estimates; otherwise, for the same bandwidth, both give very similar results, though the Parzen window requires a higher truncation lag (more autocorrelation function (ACF) values).
The frequency window smoothing procedure of
nag_tsa_uni_spectrum_daniell (g13cb) with a trapezium shape parameter
p ≃ (1/2)
$p\simeq \frac{1}{2}$ generally gives similar results for the same bandwidth as lag window methods with a slight advantage of somewhat less distortion around sharp peaks, but suffering a rather less smooth appearance in fine detail.
Crossspectrum estimation
Two functions are available for the main step in crossspectral analysis. To compute the cospectrum and quadrature spectrum estimates using smoothing by a lag window,
nag_tsa_multi_spectrum_lag (g13cc) should be used. It takes as input either the original series or crosscovariances which may be computed in a previous call of the same function or possibly using results from
nag_tsa_multi_xcorr (g13bc). As in the univariate case, this gives some advantage if estimates for the same series are to be computed with different amounts of smoothing.
The choice of window shape will be determined as the same as that which has already been used in univariate spectrum estimation for the series.
For direct frequency domain smoothing,
nag_tsa_multi_spectrum_daniell (g13cd) should be used, with similar consideration for the univariate estimation in choice of degree of smoothing.
The crossamplitude and squared coherency spectrum estimates are calculated, together with upper and lower confidence bounds, using
nag_tsa_multi_spectrum_bivar (g13ce). For input the crossspectral estimates from either
nag_tsa_multi_spectrum_lag (g13cc) or
nag_tsa_multi_spectrum_daniell (g13cd) and corresponding univariate spectra from either
nag_tsa_uni_spectrum_lag (g13ca) or
nag_tsa_uni_spectrum_daniell (g13cb) are required.
The gain and phase spectrum estimates are calculated together with upper and lower confidence bounds using
nag_tsa_multi_gain_bivar (g13cf). The required input is as for
nag_tsa_multi_spectrum_bivar (g13ce) above.
The noise spectrum estimates and impulse response function estimates are calculated together with multiplying factors for confidence limits on the former, and the standard error for the latter, using
nag_tsa_multi_noise_bivar (g13cg). The required input is again the same as for
nag_tsa_multi_spectrum_bivar (g13ce) above.
Kalman Filtering
GARCH Models
The main choice in selecting a type of GARCH model is whether the data is symmetric or asymmetric and if asymmetric what form of asymmetry should be included in the model.
A symmetric ARCH or GARCH model can be fitted by
nag_tsa_uni_garch_asym1_estim (g13fa) and the volatility forecast by
nag_tsa_uni_garch_asym1_forecast (g13fb). For asymmetric data the choice is between the type of asymmetry as described in
Section [GARCH Models].
All functions allow the option of including regressor variables in the model and the choice between Normal and Student's t$t$distribution for the errors.
Inhomogeneous Time Series
Both
nag_tsa_inhom_iema (g13me) and
nag_tsa_inhom_iema_all (g13mf) calculate the
m$m$iterated exponential moving average (EMA). In most cases
nag_tsa_inhom_iema (g13me) can be used, which returns
EMA
[τ,m ; z]
$\text{EMA}[\tau ,m;z]$ for a given value of
m$m$, overwriting the input data. Sometimes it is advantageous to have access to the intermediate results, for example when calculating the differential operator, in which case
nag_tsa_inhom_iema_all (g13mf) can be used, which can return
EMA
[τ,i ; z]$\text{EMA}[\tau ,\mathit{i};z]$, for
i = 1,2, … ,m$\mathit{i}=1,2,\dots ,m$.
nag_tsa_inhom_iema_all (g13mf) can also be used if you do not wish to overwrite the input data.
The last function,
nag_tsa_inhom_ma (g13mg) should be used if you require the moving average, (MA), moving norm (MNorm), moving variance (MVar) or moving standard deviation (MSD). Other operators can be calculated by calling a combination of these three functions and the use of simple mathematics (additions, subtractions, etc.).
Time Series Simulation
There are functions available in
Chapter G05 for generating a realisation of a time series from a specified model:
nag_rand_times_arma (g05ph) for univariate time series and
nag_rand_times_mv_varma (g05pj) for multivariate time series. There is also a suite of functions for simulating GARCH models:
nag_rand_times_garch_asym1 (g05pd),
nag_rand_times_garch_asym2 (g05pe),
nag_rand_times_garch_gjr (g05pf) and
nag_rand_times_garch_exp (g05pg).
The function
nag_rand_times_smooth_exp (g05pm) can be used to simulate data from an exponential smoothing model.
Functionality Index
Bivariate spectral analysis,   
symmetric or type I AGARCH,   
iterated exponential moving average,   
Transfer function modelling,   
Univariate spectral analysis,   
References
Akaike H (1971) Autoregressive model fitting for control Ann. Inst. Statist. Math. 23 163–180
Bollerslev T (1986) Generalised autoregressive conditional heteroskedasticity Journal of Econometrics 31 307–327
Box G E P and Jenkins G M (1976) Time Series Analysis: Forecasting and Control (Revised Edition) Holden–Day
Engle R (1982) Autoregressive conditional heteroskedasticity with estimates of the variance of United Kingdom inflation Econometrica 50 987–1008
Gentleman W S and Sande G (1966) Fast Fourier transforms for fun and profit Proc. Joint Computer Conference, AFIPS 29 563–578
Glosten L, Jagannathan R and Runkle D (1993) Relationship between the expected value and the volatility of nominal excess return on stocks Journal of Finance 48 1779–1801
Hamilton J (1994) Time Series Analysis Princeton University Press
Heyse J F and Wei W W S (1985) The partial lag autocorrelation function Technical Report No. 32 Department of Statistics, Temple University, Philadelphia
Tiao G C and Box G E P (1981) Modelling multiple time series with applications J. Am. Stat. Assoc. 76 802–816
Wei W W S (1990) Time Series Analysis: Univariate and Multivariate Methods Addison–Wesley
Zumbach G O and Müller U A (2001) Operators on inhomogeneous time series International Journal of Theoretical and Applied Finance 4(1) 147–178
PDF version (NAG web site
, 64bit version, 64bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013