LPDS: Calculate the Log Predictive Density Score for a fitted TVP...

View source: R/pred_funs.R

LPDSR Documentation

Calculate the Log Predictive Density Score for a fitted TVP model

Description

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.

Usage

LPDS(mod, data_test)

Arguments

mod

an object of class shrinkTVP, containing the fitted model for which the LPDS should be calculated.

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 shrinkTVP.

Value

A real number equaling the calculated LPDS.

Author(s)

Peter Knaus peter.knaus@wu.ac.at

See Also

Other prediction functions: eval_pred_dens(), fitted.shrinkTVP(), forecast_shrinkTVP(), predict.shrinkTVP(), residuals.shrinkTVP()

Examples


# 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,])



shrinkTVP documentation built on May 29, 2024, 7:24 a.m.

Related to LPDS in shrinkTVP...