f {forecastSNSTS}R Documentation

Compute f(δ)f(\delta) for a tvAR(p) process

Description

This functions computes the quantity f(δ)f(\delta) defined in (24) of Kley et al. (2019) when the underlying process follows an tvAR(p) process. Recall that, to apply Theorem 3.1 in Kley et al. (2019), the function f(δ)f(\delta) is required to be positive, which can be verified with the numbers returned from this function. The function returns a vector with elements f(δ)f(\delta) for each δ\delta in which.deltas, with f(δ)f(\delta) defined as

f(δ):=minp1,p2=0,,pmaxminNNMSPEs1/T,m/T(p1,h)(s1T)(1+δ)MSPEN/T,m/T(p2,h)(s1T),δ0f(\delta) := \min_{p_1,p_2 = 0, \ldots, p_{\max}} \min_{N \in \mathcal{N}} \Big| {\rm MSPE}_{s_1/T,m/T}^{(p_1,h)}(\frac{s_1}{T}) - (1+\delta) \cdot {\rm MSPE}_{N/T,m/T}^{(p_2,h)}(\frac{s_1}{T}) \Big|, \quad \delta \geq 0

where T,m,pmax,hT, m, p_{\max}, h are positive integers, N{pmax+1,,Tmh}\mathcal{N} \subset \{p_{\max}+1, \ldots, T-m-h\}, and s1:=Tmh+1s_1 := T-m-h+1.

Usage

f(which.deltas, p_max, h, T, Ns, m, a, sigma)

Arguments

which.deltas

vector containing the δ\delta's for which to to compute f(δ)f(\delta),

p_max

parameter pmaxp_{\max},

h

parameter hh,

T

parameter TT,

Ns

a vector containing the elements of the set N\mathcal{N},

m

parameter mm,

a

a list of real-valued functions, specifying the coefficients of the tvAR(p) process,

sigma

a positive-valued function, specifying the variance of the innovations of the tvAR(p) process,

Details

The function MSPEΔ1,Δ2(p,h)(u){\rm MSPE}_{\Delta_1, \Delta_2}^{(p,h)}(u) is defined, for real-valued uu and Δ1,Δ20\Delta_1, \Delta_2 \geq 0, in terms of the second order properties of the process:

MSPEΔ1,Δ2(p,h)(u):=01gΔ1(p,h)(u+Δ2(1x))dx,{\rm MSPE}_{\Delta_1, \Delta_2}^{(p,h)}(u) := \int_0^1 g^{(p,h)}_{\Delta_1}\Big( u + \Delta_2 (1-x) \Big) {\rm d}x,

with gΔ(0,h)(u):=γ0(u)g^{(0,h)}_{\Delta}(u) := \gamma_0(u) and, for p=1,2,p = 1, 2, \ldots,

gΔ(p,h)(u):=γ0(u)2(vΔ(p,h)(u))γ0(p,h)(u)+(vΔ(p,h)(u))Γ0(p)(u)vΔ(p,h)(u)g^{(p,h)}_{\Delta}(u) := \gamma_0(u) - 2 \big( v_{\Delta}^{(p,h)}(u) \big)' \gamma_0^{(p,h)}(u) + \big( v_{\Delta}^{(p,h)}(u) \big)' \Gamma_0^{(p)}(u) v_{\Delta}^{(p,h)}(u)

γ0(p,h)(u):=(γh(u),,γh+p1(u)),\gamma_0^{(p,h)}(u) := \big( \gamma_h(u), \ldots, \gamma_{h+p-1}(u) \big)',

where

vΔ(p,h)(u):=e1(e1(aΔ(p)(t))+H)h,v^{(p,h)}_{\Delta}(u) := e'_1 \big( e_1 \big( a_{\Delta}^{(p)}(t) \big)' + H \big)^h,

with e1e_1 and HH defined in the documentation of predCoef and, for every real-valued uu and Δ0\Delta \geq 0,

aΔ(p)(u):=ΓΔ(p)(u)1γΔ(p)(u),a^{(p)}_{\Delta}(u) := \Gamma^{(p)}_{\Delta}(u)^{-1} \gamma^{(p)}_{\Delta}(u),

where

γΔ(p)(u):=01γ(p)(u+Δ(x1))dx,γ(p)(u):=[γ1(u)    γp(u)],\gamma^{(p)}_{\Delta}(u) := \int_0^1 \gamma^{(p)}(u+\Delta (x-1)) {\rm d}x, \quad \gamma^{(p)}(u) := [\gamma_1(u)\;\ldots\;\gamma_p(u)]',

ΓΔ(p)(u):=01Γ(p)(u+Δ(x1))dx,Γ(p)(u):=(γij(u);i,j=1,,p).\Gamma^{(p)}_{\Delta}(u) := \int_0^1 \Gamma^{(p)}(u+\Delta (x-1)) {\rm d}x, \quad \Gamma^{(p)}(u) := (\gamma_{i-j}(u);\,i,j=1,\ldots,p).

The local autocovariances γk(u)\gamma_k(u) are defined as the lag-kk autocovariances of an AR(p) process which has coefficients a1(u),,ap(u)a_1(u), \ldots, a_p(u) and innovations with variance σ(u)2\sigma(u)^2, because the underlying model is assumed to be tvAR(p)

Yt,T=j=1paj(t/T)Ytj,T+σ(t/T)εt,Y_{t,T} = \sum_{j=1}^p a_j(t/T) Y_{t-j,T} + \sigma(t/T) \varepsilon_{t},

where a1,,apa_1, \ldots, a_p are real valued functions (defined on [0,1][0,1]) and σ\sigma is a positive function (defined on [0,1][0,1]).

Value

Returns a vector with the values f(δ)f(\delta), as defined in (24) of Kley et al. (2019), where it is now denoted by q(δ)q(\delta), for each δ\delta in which.delta.

Examples

## Not run: 
## because computation is quite time-consuming.
n <- 100
a <- list( function(u) {return(0.8+0.19*sin(4*pi*u))} )
sigma <- function (u) {return(1)}

Ns <- seq( floor((n/2)^(4/5)), floor(n^(4/5)),
           ceiling((floor(n^(4/5)) - floor((n/2)^(4/5)))/25) )
which.deltas <- c(0, 0.01, 0.05, 0.1, 0.15, 0.2, 0.4, 0.6)
P_max <- 7
H <- 1
m <- floor(n^(.85)/4)

# now replicate some results from Table 4 in Kley et al. (2019)
f( which.deltas, P_max, h = 1, n - m, Ns, m, a, sigma )
f( which.deltas, P_max, h = 5, n - m, Ns, m, a, sigma )

## End(Not run)

[Package forecastSNSTS version 1.3-0 Index]