Description Usage Arguments Details Value Examples
This functions computes the quantity f(δ) defined in (10) of
Kley et al. (2017) when the underlying process follows an tvAR(p) process.
Recall that, to apply Theorem 3.1 in Kley et al. (2017), the function
f(δ) is required to be positive, which can be verified with the
numbers returned from this function.
The function returns a vector with elements f(δ)
for each δ in which.deltas
, with f(δ)
defined as
f(δ) := \min_{p_1,p_2 = 0, …, p_{\max}} \min_{N \in \mathcal{N}} \Big| {\rm MSPE}_{s_1/T,m/T}^{(p_1,h)}(\frac{s_1}{T}) - (1+δ) \cdot {\rm MSPE}_{N/T,m/T}^{(p_2,h)}(\frac{s_1}{T}) \Big|, \quad δ ≥q 0
where T, m, p_{\max}, h are positive integers, \mathcal{N} \subset \{p_{\max}+1, …, T-m-h\}, and s_1 := T-m-h+1.
1 |
which.deltas |
vector containing the δ's for which to to compute f(δ), |
p_max |
parameter p_{\max}, |
h |
parameter h, |
T |
parameter T, |
Ns |
a vector containing the elements of the set \mathcal{N}, |
m |
parameter m, |
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, |
The function {\rm MSPE}_{Δ_1, Δ_2}^{(p,h)}(u) is defined, for real-valued u and Δ_1, Δ_2 ≥q 0, in terms of the second order properties of the process:
{\rm MSPE}_{Δ_1, Δ_2}^{(p,h)}(u) := \int_0^1 g^{(p,h)}_{Δ_1}\Big( u + Δ_2 (1-x) \Big) {\rm d}x,
with g^{(0,h)}_{Δ}(u) := γ_0(u) and, for p = 1, 2, …,
g^{(p,h)}_{Δ}(u) := γ_0(u) - 2 \big( v_{Δ}^{(p,h)}(u) \big)' γ_0^{(p,h)}(u) + \big( v_{Δ}^{(p,h)}(u) \big)' Γ_0^{(p)}(u) v_{Δ}^{(p,h)}(u)
γ_0^{(p,h)}(u) := \big( γ_h(u), …, γ_{h+p-1}(u) \big)',
where
v^{(p,h)}_{Δ}(u) := e'_1 \big( e_1 \big( a_{Δ}^{(p)}(t) \big)' + H \big)^h,
with e_1 and H defined in the documentation of predCoef
and,
for every real-valued u and Δ ≥q 0,
a^{(p)}_{Δ}(u) := Γ^{(p)}_{Δ}(u)^{-1} γ^{(p)}_{Δ}(u),
where
γ^{(p)}_{Δ}(u) := \int_0^1 γ^{(p)}(u+Δ (x-1)) {\rm d}x, \quad γ^{(p)}(u) := [γ_1(u)\;…\;γ_p(u)]',
Γ^{(p)}_{Δ}(u) := \int_0^1 Γ^{(p)}(u+Δ (x-1)) {\rm d}x, \quad Γ^{(p)}(u) := (γ_{i-j}(u);\,i,j=1,…,p).
The local autocovariances γ_k(u) are defined as the lag-k autocovariances of an AR(p) process which has coefficients a_1(u), …, a_p(u) and innovations with variance σ(u)^2, because the underlying model is assumed to be tvAR(p)
Y_{t,T} = ∑_{j=1}^p a_j(t/T) Y_{t-j,T} + σ(t/T) \varepsilon_{t},
where a_1, …, a_p are real valued functions (defined on [0,1]) and σ is a positive function (defined on [0,1]).
Returns a vector with the values f(δ), as defined in
(10) of Kley et al. (2017), for each δ in
which.delta
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## 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. (2017)
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.