LPDS | R Documentation |
LPDS
calculates the one-step ahead Log Predictive Density Score (LPDS) of a fitted TVP model resulting from a call to
shrinkTVP
For details on the approximation of the one-step ahead predictive density used, see the vignette.
LPDS(mod, data_test)
mod |
an object of class |
data_test |
a data frame with one row, containing the one-step ahead covariates and response. The names of the covariates
and the response have to match the names used during model estimation in the call to |
A real number equaling the calculated LPDS.
Peter Knaus peter.knaus@wu.ac.at
Other prediction functions:
eval_pred_dens()
,
fitted.shrinkTVP()
,
forecast_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:199, ])
# Calculate LPDS
LPDS(res, data[200,])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.