Learn R Programming

VARDetect (version 0.1.8)

plot.VARDetect.result: Plotting the output from VARDetect.result class

Description

Plotting method for S3 object of class VARDetect.result

Usage

# S3 method for VARDetect.result
plot(
  x,
  display = c("cp", "param", "granger", "density"),
  threshold = 0.1,
  layout = c("circle", "star", "nicely"),
  ...
)

Value

A plot for change points or a series of plots for Granger causal networks for estimated model parameters

Arguments

x

a VARDetect.result object

display

a character string, indicates the object the user wants to plot; possible values are

"cp"

input time series together with the estimated change points

"param"

estimated model parameters

"granger"

present the model parameters through Granger causal networks

"density"

plot the sparsity levels across all segments

threshold

a positive numeric value, indicates the threshold to present the entries in the sparse matrices

layout

a character string, indicating the layout of the Granger network

...

not in use

Examples

Run this code
nob <- 1000
p <- 15
brk <- c(floor(nob / 3), floor(2 * nob / 3), nob + 1)
m <- length(brk)
q.t <- 1
try <- simu_var('sparse',nob=nob,k=p,lags=q.t,brk=brk,sp_pattern="off-diagonal",seed = 1)
data <- try$series
data <- as.matrix(data)
fit <- tbss(data, method = "sparse", q = q.t)
plot(fit, display = "cp")
plot(fit, display = "param")
plot(fit, display = "granger", threshold = 0.2, layout = "nicely")
plot(fit, display = "density", threshold = 0.2)

Run the code above in your browser using DataLab