Learn R Programming

BGVAR (version 2.1.0)

plot: Graphical summary of output created with bgvar

Description

Plotting function for fitted values, residuals, predictions, impulse responses and forecast error variance decompositions created with the BGVAR package.

Usage

# S3 method for bgvar
plot(x, ..., resp = NULL, global = TRUE)

# S3 method for bgvar.resid plot(x, ..., resp = NULL, global = TRUE)

# S3 method for bgvar.pred plot(x, ..., resp = NULL, Cut = 40)

# S3 method for bgvar.irf plot(x, ..., resp = NULL, shock.nr = 1, cumulative = FALSE)

# S3 method for bgvar.fevd plot(x, ..., resp, k.max = 10)

Arguments

x

either an object of class bgvar, bgvar.res, bgvar.irf, bgvar.predict or bgvar.fevd.

...

additional arguments.

resp

specify a variable to plot predictions.

global

if TRUE global residuals are plotted, otherwise country residuals.

Cut

length of series to be plotted before prediction begins.

shock.nr

specify shock to be plotted.

cumulative

whether cumulative impulse response functions should be plotted. Default is set to FALSE.

k.max

plots the k series with the highest for the decomposition of resp.

Value

No return value.

Examples

Run this code
# NOT RUN {
library(BGVAR)
data(eerData)
model.ssvs <- bgvar(Data=eerData,W=W.trade0012,plag=1,draws=100,burnin=100,
                    prior="SSVS")
# example for class 'bgvar'
plot(model.ssvs, resp="EA")
# }
# NOT RUN {
# example for class 'bgvar.resid'
res <- residuals(model.ssvs)
plot(res, resp="EA")
# }
# NOT RUN {
# example for class 'bgvar.pred'
fcast <- predict(model.ssvs,n.ahead=8,save.store=TRUE)
plot(fcast, resp="US.Dp", Cut=20)
# }
# NOT RUN {
# example for class 'bgvar.irf'
shocks<-list();shocks$var="stir";shocks$cN<-"US";shocks$ident="chol";shocks$scal=-100
irf.chol.us.mp<-irf(model.ssvs,shock=shocks,n.ahead=24)
plot(irf.chol.us.mp,resp="US.y")
# }
# NOT RUN {
# example for class 'bgvar.fevd'
fevd.us.mp=fevd(irf.chol.us.mp,var.slct=c("US.Dp","EA.y"))
plot(fevd.us.mp, resp="US.Dp", k.max=10)
# }

Run the code above in your browser using DataLab