Learn R Programming

bigtime (version 0.2.3)

diagnostics_plot: Creates a Diagnostic Plot

Description

Creates a Diagnostic Plot

Usage

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

Value

Returns a ggplot2 plot

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.

Examples

Run this code
# 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
if (FALSE) {
# VARMA example
data(varma.example)
varma <- sparseVARMA(Y=scale(Y.varma), VARMAselection="cv")
diagnostics_plot(varma, variable = 2) # Plotting the second variable
}
if (FALSE) {
# 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
}

Run the code above in your browser using DataLab