View source: R/shrinkTVPVAR_methods.R
forecast_shrinkTVPVAR | R Documentation |
forecast_shrinkTVPVAR
draws from the posterior predictive distribution of a fitted TVP-VAR-SV model resulting from a call to
shrinkTVPVAR
or shrinkDTVPVAR
.
forecast_shrinkTVPVAR(mod, n.ahead = 1)
mod |
an object of class |
n.ahead |
a single, positive integer indicating the forecasting horizon, i.e. how many time-points into the future
the posterior predictive distribution should be sampled from. Can not be larger than the number of rows in |
The value returned is a list object of class shrinkTVPVAR_forc
containing the samples from the
posterior predictive density.
Peter Knaus peter.knaus@wu.ac.at
Other prediction functions:
LPDS()
,
fitted.shrinkTVPVAR()
set.seed(123)
sim <- simTVPVAR(p = 2)
data <- sim$data
res <- shrinkTVPVAR(data, p = 2)
forc <- forecast_shrinkTVPVAR(res, n.ahead = 4)
# Visualize forecast
plot(forc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.