Learn R Programming

gmvarkit (version 1.5.0)

diagnostic_plot: Quantile residual diagnostic plot for a GMVAR model

Description

diagnostic_plot plots a multivariate quantile residual diagnostic plot for either autocorrelation, conditional heteroskedasticity, or normality, or simply draws the quantile residual time series.

Usage

diagnostic_plot(
  gmvar,
  type = c("all", "series", "ac", "ch", "norm"),
  maxlag = 12,
  wait_time = 4
)

Arguments

gmvar

an object of class 'gmvar' created with fitGMVAR or GMVAR.

type

which type of diagnostic plot should be plotted?

  • "all" all below sequentially.

  • "series" the quantile residual time series.

  • "ac" the quantile residual autocorrelation and cross-correlation functions.

  • "ch" the squared quantile residual autocorrelation and cross-correlation functions.

  • "norm" the quantile residual histogram with theoretical standard normal density (dashed line) and standard normal QQ-plots.

maxlag

the maximum lag considered in types "ac" and "ch".

wait_time

if type == all how many seconds to wait before showing next figure?

Details

Auto- and cross-correlations (types "ac" and "ch") are calculated with the function acf from the package stats and the plot method for class 'acf' objects is employed.

References

  • Kalliovirta L., Meitz M. and Saikkonen P. 2016. Gaussian mixture vector autoregression. Journal of Econometrics, 192, 485-498.

  • Kalliovirta L. and Saikkonen P. 2010. Reliable Residuals for Multivariate Nonlinear Time Series Models. Unpublished Revision of HECER Discussion Paper No. 247.

  • Virolainen S. 2020. Structural Gaussian mixture vector autoregressive model. Unpublished working paper, available as arXiv:2007.04713.

See Also

profile_logliks, fitGMVAR, GMVAR, quantile_residual_tests, LR_test, Wald_test, cond_moment_plot, acf, density, predict.gmvar

Examples

Run this code
# NOT RUN {
# GMVAR(1,2), d=2 model:
params12 <- c(0.55, 0.112, 0.344, 0.055, -0.009, 0.718, 0.319,
 0.005, 0.03, 0.619, 0.173, 0.255, 0.017, -0.136, 0.858, 1.185,
 -0.012, 0.136, 0.674)
mod12 <- GMVAR(gdpdef, p=1, M=2, params=params12)
diagnostic_plot(mod12, type="series")
diagnostic_plot(mod12, type="ac")

# GMVAR(2,2), d=2 model:
params22 <-  c(0.36, 0.121, 0.223, 0.059, -0.151, 0.395, 0.406,
 -0.005, 0.083, 0.299, 0.215, 0.002, 0.03, 0.484, 0.072, 0.218,
 0.02, -0.119, 0.722, 0.093, 0.032, 0.044, 0.191, 1.101, -0.004,
  0.105, 0.58)
mod22 <- GMVAR(gdpdef, p=2, M=2, params=params22)
diagnostic_plot(mod22, type="ch")
diagnostic_plot(mod22, type="norm")

# GMVAR(2,2), d=2 model with AR-parameters restricted to be
# the same for both regimes:
C_mat <- rbind(diag(2*2^2), diag(2*2^2))
params22c <- c(0.418, 0.153, 0.513, 0.057, 0.204, 0.028, -0.169,
 0.591, 0.241, 0.014, 0.091, 0.248, 1.068, -0.01, 0.111, 0.219,
 0.004, 0.027, 0.501)
mod22c <- GMVAR(gdpdef, p=2, M=2, params=params22c, constraints=C_mat)
diagnostic_plot(mod22c, wait_time=0.2)
diagnostic_plot(mod22c, type="ac", maxlag=12)
# }

Run the code above in your browser using DataLab