forecast_shrinkTVP | R Documentation |
forecast_shrinkTVP
draws from the posterior predictive distribution of a fitted TVP model resulting from a call to
shrinkTVP
.
forecast_shrinkTVP(mod, newdata, n.ahead)
mod |
an object of class |
newdata |
a data frame containing the future covariates. The names of the covariates
have to match the names used during model estimation in the call to |
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 shrinkTVP_forc
containing the samples from the
posterior predictive density.
Peter Knaus peter.knaus@wu.ac.at
Other prediction functions:
LPDS()
,
eval_pred_dens()
,
fitted.shrinkTVP()
,
predict.shrinkTVP()
,
residuals.shrinkTVP()
# Simulate data
set.seed(123)
sim <- simTVP(theta = c(0.2, 0, 0), beta_mean = c(1.5, -0.3, 0))
data <- sim$data
# Estimate model
res <- shrinkTVP(y ~ x1 + x2, data = data[1:190, ])
# Forecast
forc <- forecast_shrinkTVP(res, data[191:200, ])
# Plot
plot(forc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.