diagnostics_plot: Creates a Diagnostic Plot

View source: R/diagnostics.R

diagnostics_plotR Documentation

Creates a Diagnostic Plot

Description

Creates a Diagnostic Plot

Usage

diagnostics_plot(mod, variable = 1, dates = NULL)

Arguments

mod

VAR model estimated using sparseVAR, sparseVARMA, or sparseVARX

variable

Variable to show. Either numeric (which column) or character (variable name)

dates

Optional Date vector.

Value

Returns a ggplot2 plot

Examples

# VAR example
dat <- simVAR(periods=200, k=2, p=5, decay = 0.1, seed = 6150533,
                       sparsity_pattern = "hvar")
mod <- sparseVAR(Y=scale(dat$Y), selection = "bic", h = 1)
diagnostics_plot(mod, variable = 1) # Plotting the first variable
## Not run: 
# VARMA example
data(varma.example)
varma <- sparseVARMA(Y=scale(Y.varma), VARMAselection="cv")
diagnostics_plot(varma, variable = 2) # Plotting the second variable

## End(Not run)
## Not run: 
# VARX example
data(varx.example)
varx <- sparseVARX(Y=scale(Y.varx), X=scale(X.varx), selection="cv")
diagnostics_plot(varx, variable = 1) # Plotting the first variable

## End(Not run)

bigtime documentation built on Aug. 22, 2023, 1:08 a.m.