Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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 class 'bgvar'
plot(x, ..., resp = NULL, global = TRUE)

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

## S3 method for class 'bgvar.pred'
plot(x, ..., resp = NULL, cut = 40, quantiles = c(0.1, 0.16, 0.5, 0.84, 0.9))

## S3 method for class 'bgvar.irf'
plot(
  x,
  ...,
  resp = NULL,
  shock = 1,
  quantiles = c(0.1, 0.16, 0.5, 0.84, 0.9),
  cumulative = FALSE
)

## S3 method for class '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 either a specific variable, a specific country or a specific variable in a specific country which should be plotted. If set to NULL all countries is plotted.

global

if TRUE global residuals are plotted, otherwise country residuals.

cut

length of series to be plotted before prediction begins.

quantiles

Numeric vector with posterior quantiles. Default is set to plot median along with 68%/80% confidence intervals.

shock

Specify the shock which should 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.

Author(s)

Maximilian Boeck, Martin Feldkircher

Examples

model.ssvs <- bgvar(Data=eerData,W=W.trade0012,plag=1,draws=100,burnin=100,
                    prior="SSVS")

# example for class 'bgvar'
plot(model.ssvs, resp=c("EA.y","US.Dp"))


# example for class 'bgvar.resid'
res <- residuals(model.ssvs)
plot(res, resp="EA.y")


# example for class 'bgvar.pred'
fcast <- predict(model.ssvs,n.ahead=8)
plot(fcast, resp="y", cut=20)


# example for class 'bgvar.irf'
shockinfo <- get_shockinfo("chol")
shockinfo$shock <- "US.stir"; shockinfo$scale <- +1
irf.chol<-irf(model.ssvs, n.ahead=24, ident="chol", shockinfo=shockinfo)
plot(irf.chol, resp="US")


# example for class 'bgvar.fevd'
fevd.us=fevd(irf.chol,var.slct=c("US.stir"))
plot(fevd.us, resp="US.stir", k.max=10)

BGVAR

Bayesian Global Vector Autoregressions

v2.2.0
GPL-3
Authors
Maximilian Boeck [aut, cre] (<https://orcid.org/0000-0001-6024-8305>), Martin Feldkircher [aut] (<https://orcid.org/0000-0002-5511-9215>), Florian Huber [aut] (<https://orcid.org/0000-0002-2896-7921>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.