Learn R Programming

shrinkTVP (version 3.0.1)

plot.shrinkTVP_forc: Graphical summary of posterior predictive density

Description

plot.shrinkTVP_forc generates plots visualizing the posterior predictive density generated by forecast_shrinkTVP.

Usage

# S3 method for shrinkTVP_forc
plot(x, showgap = FALSE, ...)

Value

Called for its side effects and returns invisibly.

Arguments

x

a shrinkTVP_forc object.

showgap

if showgap = FALSE, the gap between the historical observations and the forecasts is removed. The default value is FALSE.

...

further arguments to be passed to plot.

Author

Peter Knaus peter.knaus@wu.ac.at

See Also

Other plotting functions: plot.mcmc.tvp(), plot.shrinkTVP()

Examples

Run this code
# \donttest{
set.seed(123)
sim <- simTVP()

train <- sim$data[1:190, ]
test <- sim$data[191:200, ]

res <- shrinkTVP(y ~ x1 + x2, train)

forecast <- forecast_shrinkTVP(res, test)
plot(forecast)
lines(sim$data$y, col = "forestgreen")

# }

Run the code above in your browser using DataLab