speci.VAR: Criteria on the lag-order and break period(s)

View source: R/speci.R

speci.VARR Documentation

Criteria on the lag-order and break period(s)

Description

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.

Usage

speci.VAR(
  x,
  lag_set = 1:10,
  dim_m = FALSE,
  trim = 0.15,
  type_break = "const",
  add_dummy = FALSE,
  n.cores = 1
)

Arguments

x

VAR object of class 'varx' or any other that will be coerced to 'varx'. Specifically for vars' VAR, use p = min(lag_set) or simply p=1 such that the customized $D from the coerced 'varx' object contains no NA in the effective sample.

lag_set

Vector. Set of candidates for the lag-order p. If only a single integer is provided, the criteria just reflect the variation of det(\hat{U}_{\tau} \hat{U}_{\tau}') uniformly and determine the break period(s) \tau unanimously as \hat{\tau} = arg min det(\hat{U}_{\tau} \hat{U}_{\tau}') under the given p.

dim_m

Integer. Number of breaks in the deterministic term to consider. If FALSE (the default), the criteria determine only the lag-order p just like vars' VARselect.

trim

Numeric. Either a numeric value h \in (p_{max}/T, 1/m) that defines the minimal fraction relative to the total sample size T or an integer that defines the minimal number of observations in each sub-sample. For example, h=0.15 (the default) specifies the window [0.15 \cdot T, 0.85 \cdot T] that is often used as the set of candidates for m=1 single period \tau_1.

type_break

Character. Whether the m common breaks pertain the 'const' (the default), the linear 'trend', or 'both'. Adds the period-specific deterministic term activated during \tau.

add_dummy

Logical. If TRUE (not the default), accompanying impulse dummies activated in \tau + (0, \ldots, p-1) are added to each break.

n.cores

Integer. Number of allocated processor cores. Note that parallel processing is exclusively activated for the combined determination of lag-order p and break period(s) \tau only.

Details

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.

Value

A list of class 'speci', which contains the elements:

df

A 'data.frame' of (1+m) + 4 columns for all admissible combinations of candidate (p, \tau) and their values of AIC(p, \tau), HQC(p, \tau), SIC(p, \tau), and FPE(p, \tau).

selection

A (1+m) \times 4 matrix of the specification pairs (p^*, \tau^*) suggested by the global minimum of the AIC (Akaike 1969), HQC (Hannan, Quinn 1979), SIC (Schwarz 1978), and FPE respectively.

args_speci

List of characters and integers indicating the specifications that have been used.

References

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.

See Also

Other specification functions: speci.factors()

Examples

### 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)


pvars documentation built on Nov. 5, 2025, 6:57 p.m.