predCoef {forecastSNSTS}R Documentation

hh-step Prediction coefficients

Description

This function computes the localised and iterated Yule-Walker coefficients for h-step ahead forecasting of Xt+hX_{t+h} from Xt,...,Xtp+1X_{t}, ..., X_{t-p+1}, where h=1,,h = 1, \ldots, H and p=1,,p = 1, \ldots, P.

Arguments

X

the data X1,,XTX_1, \ldots, X_T

P

the maximum order of coefficients to be computed; has to be a positive integer

H

the maximum lead time; has to be a positive integer

t

a vector of values tt; the elements have to satisfy max(t) <= length(X) and min(t) >= min(max(N[N != 0]),p).

N

a vector of values NN; the elements have to satisfy max(N[N != 0]) <= min(t) and min(N[N != 0]) >= 1 + P. N=0N = 0 corresponds to the case where all data is taken into account.

Details

For every tt \in t and every NN \in N the (iterated) Yule-Walker estimates v^N,T(p,h)(t)\hat v_{N,T}^{(p,h)}(t) are computed. They are defined as

v^N,T(p,h)(t):=e1(e1(a^N,T(p)(t))+H)h,N1,\hat v_{N,T}^{(p,h)}(t) := e'_1 \big( e_1 \big( \hat a_{N,T}^{(p)}(t) \big)' + H \big)^h, \quad N \geq 1,

and

v^0,T(p,h)(t):=v^t,T(p,h)(t),\hat v_{0,T}^{(p,h)}(t) := \hat v_{t,T}^{(p,h)}(t),

with

e1:=(100),H:=(000010000100000010) e_1 := \left(\begin{array}{c} 1 \\ 0 \\ \vdots \\ 0 \end{array} \right), \quad H := \left( \begin{array}{ccccc} 0 & 0 & \cdots & 0 & 0 \\ 1 & 0 & \cdots & 0 & 0 \\ 0 & 1 & \cdots & 0 & 0 \\ \vdots & \ddots & \cdots & 0 & 0 \\ 0 & 0 & \cdots & 1 & 0 \end{array} \right)

and

a^N,T(p)(t):=(Γ^N,T(p)(t))1γ^N,T(p)(t), \hat a_{N,T}^{(p)}(t) := \big( \hat\Gamma_{N,T}^{(p)}(t) \big)^{-1} \hat\gamma_{N,T}^{(p)}(t),

where

Γ^N,T(p)(t):=[γ^ij;N,T(t)]i,j=1,,p,γ^N,T(p)(t):=(γ^1;N,T(t),,γ^p;N,T(t))\hat\Gamma_{N,T}^{(p)}(t) := \big[ \hat \gamma_{i-j;N,T}(t) \big]_{i,j = 1, \ldots, p}, \quad \hat \gamma_{N,T}^{(p)}(t) := \big( \hat \gamma_{1;N,T}(t), \ldots, \hat \gamma_{p;N,T}(t) \big)'

and

γ^k;N,T(t):=1N=tN+k+1tXk,TX,T\hat \gamma_{k;N,T}(t) := \frac{1}{N} \sum_{\ell=t-N+|k|+1}^{t} X_{\ell-|k|,T} X_{\ell,T}

is the usual lag-kk autocovariance estimator (without mean adjustment), computed from the observations XtN+1,,XtX_{t-N+1}, \ldots, X_{t}.

The Durbin-Levinson Algorithm is used to successively compute the solutions to the Yule-Walker equations (cf. Brockwell/Davis (1991), Proposition 5.2.1). To compute the hh-step ahead coefficients we use the recursive relationship

v^i,N,T(p)(t,h)=a^i,N,T(p)(t)v^1,N,T(p,h1)(t)+v^i+1,N,T(p,h1)(t)I{ip1},\hat v_{i,N,T}^{(p)}(t,h) = \hat a_{i,N,T}^{(p)}(t) \hat v_{1,N,T}^{(p,h-1)}(t) + \hat v_{i+1,N,T}^{(p,h-1)}(t) I\{i \leq p-1\},

(cf. Section 3.2, Step 3, in Kley et al. (2019)).

Value

Returns a named list with elements coef, t, and N, where coef is an array of dimension P ×\times P ×\times H ×\times length(t) ×\times length(N), and t, and N are the parameters provided on the call of the function. See the example on how to access the vector v^N,T(p,h)(t)\hat v_{N,T}^{(p,h)}(t).

References

Brockwell, P. J. & Davis, R. A. (1991). Time Series: Theory and Methods. Springer, New York.

Examples

T <- 100
X <- rnorm(T)

P <- 5
H <- 1
m <- 20

Nmin <- 25
pcoef <- predCoef(X, P, H, (T - m - H + 1):T, c(0, seq(Nmin, T - m - H, 1)))

## Access the prediction vector for p = 2, h = 1, t = 95, N = 25
p <- 2
h <- 1
t <- 95
N <- 35
res <- pcoef$coef[p, 1:p, h, pcoef$t == t, pcoef$N == N]

[Package forecastSNSTS version 1.3-0 Index]