diagnostic_plot: Quantile residual diagnostic plot for a GMVAR, StMVAR, or...

View source: R/diagnosticPlot.R

diagnostic_plotR Documentation

Quantile residual diagnostic plot for a GMVAR, StMVAR, or G-StMVAR 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(
  gsmvar,
  type = c("all", "series", "ac", "ch", "norm"),
  maxlag = 12,
  wait_time = 4
)

Arguments

gsmvar

an object of class 'gsmvar', typically created with fitGSMVAR or GSMVAR.

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. 2022. Structural Gaussian mixture vector autoregressive model with application to the asymmetric effects of monetary policy shocks. Unpublished working paper, available as arXiv:2007.04713.

  • Virolainen S. 2022. Gaussian and Student's t mixture vector autoregressive model with application to the asymmetric effects of monetary policy shocks in the Euro area. Unpublished working paper, available as arXiv:2109.13648.

See Also

profile_logliks, fitGSMVAR, GSMVAR, quantile_residual_tests, LR_test, Wald_test, Rao_test, cond_moment_plot, acf, density, predict.gsmvar

Examples

# 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 <- GSMVAR(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 <- GSMVAR(gdpdef, p=2, M=2, params=params22)
diagnostic_plot(mod22, type="ch")
diagnostic_plot(mod22, type="norm")

# G-StMVAR(2, 1, 1), d=2 model:
params22gs <- c(0.697, 0.154, 0.049, 0.374, 0.476, 0.318, -0.645, -0.302,
 -0.222, 0.193, 0.042, -0.013, 0.048, 0.554, 0.033, 0.184, 0.005, -0.186,
  0.683, 0.256, 0.031, 0.026, 0.204, 0.583, -0.002, 0.048, 0.182, 4.334)
mod22gs <- GSMVAR(gdpdef, p=2, M=c(1, 1), params=params22gs, model="G-StMVAR")
diagnostic_plot(mod22gs, wait_time=0)

gmvarkit documentation built on Nov. 15, 2023, 1:07 a.m.