Learn R Programming

gmvarkit (version 1.4.1)

cond_moment_plot: Conditional mean or variance plot for a GMVAR model

Description

cond_moment_plot plots the one-step in-sample conditional means/variances of the model along with the individual time series contained in the model (e.g. the time series the model was fitted to). Also plots the regimewise conditional means/variances multiplied with mixing weights.

Usage

cond_moment_plot(
  gmvar,
  which_moment = c("mean", "variance"),
  grid = FALSE,
  ...
)

Arguments

gmvar

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

which_moment

should conditional means or variances be plotted?

grid

add grid to the plots?

...

additional paramters passed to grid(...) plotting the grid if grid == TRUE.

Details

The conditional mean plot works best if the data contains positive values only. 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.

  • L<U+00FC>tkepohl H. 2005. New Introduction to Multiple Time Series Analysis, Springer.

  • McElroy T. 2017. Computation of vector ARMA autocovariances. Statistics and Probability Letters, 124, 92-96.

  • 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, diagnostic_plot

Examples

Run this code
# NOT RUN {
# These examples use the data 'eurusd' which comes with the
# package, but in a scaled form.
data <- cbind(10*eurusd[,1], 100*eurusd[,2])
colnames(data) <- colnames(eurusd)

# GMVAR(2,2), d=2 model:
params222 <-  c(1.386, -0.765, 1.314, 0.145, 0.094, 1.292, -0.389,
 -0.070, -0.109, -0.281, 0.920, -0.025, 4.839, 1.005, 5.928, 1.248,
  0.077, -0.040, 1.266, -0.272, -0.074, 0.034, -0.313, 5.855, 3.570,
  9.838, 0.740)
mod222 <- GMVAR(data, p=2, M=2, params=params222)

cond_moment_plot(mod222, which_moment="mean")
cond_moment_plot(mod222, which_moment="variance")
cond_moment_plot(mod222, which_moment="mean", grid=TRUE, lty=2)
# }

Run the code above in your browser using DataLab