Learn R Programming

eDMA (version 1.5-3)

BacktestDMA: Backtest measures for Dynamic Model Averaging and comparison with Dynamic Model Selection

Description

Backtest measures for Dynamic Model Averaging and comparison with Dynamic Model Selection. This function evaluates the out of sample performance of DMA and compare it with DMS.

Usage

BacktestDMA(object, iBurnPeriod = NULL)

Arguments

object

an object of the class DMA-class, created using the function DMA.

iBurnPeriod

An integer indicating the length of the burn-in period. By default iBurnPeriod = NULL. If iBurnPeriod = NULL then one third of the total sample is used as the burn-in in period and a warning is printed.

Value

An object of the class matrix.

Details

The function returns a matrix with Mean Squared Error (MSE), Mean Absolute Error (MAD) and Predictive Likelihood for DMA and DMS using the predictions during the out-of-sample period.

Examples

Run this code
# NOT RUN {
library(eDMA)

## load data
data("USData")

## do DMA, keep the first three predictors fixed and the intercept
Fit <- DMA(GDPDEF ~ Lag(GDPDEF, 1) + Lag(GDPDEF, 2) + Lag(GDPDEF, 3) +
            Lag(ROUTP, 1) + Lag(UNEMP, 1), data = USData, vDelta = c(0.9, 0.95, 0.99),
            vKeep = c(1, 2, 3))

BacktestDMA(Fit, iBurnPeriod = 32)

# }

Run the code above in your browser using DataLab