| speci.VAR | R Documentation |
Determines the lag-order p and break period(s) \tau
jointly via information criteria on the OLS-estimated VAR model for a given
number of breaks. These m breaks are common to all K equations
of the system and partial, as pertaining the
deterministic term only.
speci.VAR(
x,
lag_set = 1:10,
dim_m = FALSE,
trim = 0.15,
type_break = "const",
add_dummy = FALSE,
n.cores = 1
)
x |
VAR object of class ' |
lag_set |
Vector. Set of candidates for the lag-order |
dim_m |
Integer. Number of breaks in the deterministic term to consider.
If |
trim |
Numeric. Either a numeric value |
type_break |
Character. Whether the |
add_dummy |
Logical. If |
n.cores |
Integer. Number of allocated processor cores.
Note that parallel processing is exclusively activated for the combined
determination of lag-order |
The literature on structural breaks in time series deals mostly with
the determination of the number m and position \tau of breaks
(e.g. Bai, Perron 1998 and 2003), but leaves the lag-order p aside.
For example, under a given p, Luetkepohl et al. (2004) use a full-rank
VAR in levels to determine m=1 common break period \tau_1
and subsequently perform cointegration analysis with coint.SL
(which actually provides p-values for up to m=2).
Note yet that the lag-order of a VECM is usually determined via
information criteria of a full-rank VAR in levels alike.
speci.VAR combines Bai, Perron (2003) and Approach 3 of Yang (2002)
into a global minimization of information criteria on the pair (p,\tau).
Specifically, Yang (2002:378, Ch.2.2) estimates all candidate VAR models by
OLS and then determines their optimal lag-order p^* and m=1 break
period \tau^* jointly via the global minimum of the information criteria.
Bai and Perron (2003, Ch.3) determine
\tau^* = (\tau_1^*, \ldots, \tau_m^*) of multiple breaks via the
minimum sum of squared residuals from a single-equation model (K=1).
They use dynamic programming to reduce the number of least-squares operations.
Although adapting their streamlined set of admissible combinations for \tau,
speci.VAR yet resorts to (parallelized brute-force) OLS estimation
of all candidate VAR models and therewith circumvents issues of correct
initialization and iterative updating for the models with partial breaks.
A list of class 'speci', which contains the elements:
df |
A ' |
selection |
A |
args_speci |
List of characters and integers indicating the specifications that have been used. |
Bai, J., and Perron, P. (1998): "Estimating and Testing Linear Models with Multiple Structural Changes", Econometrica, 66, pp. 47-78.
Bai, J., and Perron, P. (2003): "Computation and Analysis of Multiple Structural Change Models", Journal of Applied Econometrics, 18, pp. 1-22.
Luetkepohl, H., Saikkonen, P., and Trenkler, C. (2004): "Testing for the Cointegrating Rank of a VAR Process with Level Shift at Unknown Time", Econometrica, 72, pp. 647-662.
Yang, M. (2002): "Lag Length and Mean Break in Stationary VAR Models", Econometrics Journal, 5, pp. 374-386.
Other specification functions:
speci.factors()
### extend basic example in "urca" ###
library("urca")
library("vars")
data("denmark")
sjd = denmark[, c("LRM", "LRY", "IBO", "IDE")]
# use the single lag-order p=2 to determine only the break period #
R.vars = VAR(sjd, type="both", p=1, season=4)
R.speci = speci.VAR(R.vars, lag_set=2, dim_m=1, trim=3, add_dummy=FALSE)
library("ggfortify")
autoplot(ts(R.speci$df[3:5], start=1+R.speci$args_speci$trim),
main="For a single 'p', all IC just reflect the variation of det(UU').")
print(R.speci)
# perform cointegration test procedure with detrending #
R.t_D = list(t_shift=8, n.season=4)
R.coint = coint.SL(sjd, dim_p=2, type_SL="SL_trend", t_D=R.t_D)
summary(R.coint)
# m=1: line plot #
library("ggplot2")
R.speci1 = speci.VAR(R.vars, lag_set=1:5, dim_m=1, trim=6)
R.values = c("#BDD7E7", "#6BAED6", "#3182BD", "#08519C", "#08306B")
F.line = ggplot(R.speci1$df) +
geom_line( aes(x=tau_1, y=HQC, color=as.factor(p), group=as.factor(p))) +
geom_point(aes(x=tau_1, y=HQC, color=as.factor(p), group=as.factor(p))) +
geom_point(x=R.speci1$selection["tau_1", "HQC"],
y=min(R.speci1$df$HQC), color="red") +
scale_x_continuous(limits=c(1, nrow(sjd))) +
scale_color_manual(values=R.values) +
labs(x=expression(tau), y="HQ Criterion", color="Lag order", title=NULL) +
theme_bw()
plot(F.line)
# m=2: discrete heat map #
R.speci2 = speci.VAR(R.vars, lag_set=2, dim_m=2, trim=3)
dim_T = nrow(sjd) # total sample size
F.heat = ggplot(R.speci2$df) +
geom_point(aes(x=tau_1, y=tau_2, color=AIC), size=3) +
geom_abline(intercept=0, slope=-1, color="grey") +
scale_x_continuous(limits=c(1, dim_T), expand=c(0, 0)) +
scale_y_reverse(limits=c(dim_T, 1), expand=c(0, 0)) +
scale_color_continuous(type="viridis") +
labs(x=expression(tau[1]), y=expression(tau[2]), color="AIC", title=NULL) +
theme_bw()
plot(F.heat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.