clarkwest: Clark and West's (2006, 2007) Out-of-Sample Test

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Functions to calculate Clark and West's (2006, 2007) approximately normal oos statistic.

Usage

1
2
3
4
clarkwest(null, alt, dataset, R, vcv = var,
          window = c("rolling", "recursive", "fixed"))

clarkwest_calculation(target, null.forecast, alt.forecast, vcv)

Arguments

null

A function that takes a subset of the data dataset as its argument and returns an object with a predict method. This function generates the benchmark forecast.

alt

A second function that takes a subset of the data dataset as its argument and returns an object with a predict method. This function generates the alternative forecast.

dataset

A data frame.

R

An integer, the size of the training sample.

vcv

A function to calculate the asymptotic variance of the oos average.

window

A character that indicates the window strategy for oos estimation.

target

A vector containing the values of the predictand.

null.forecast

A vector containing the values of the benchmark forecast.

alt.forecast

A vector containing the values of the alternative forecast.

Details

Both of these functions implement Clark and West's (2006, 2007) "corrected" out-of-sample tests. The idea behind their tests is that using a fixed-length rolling window, as in Giacomini and White (2006), ensures that the oos average is asymptotically normal. In Giacomini and White, though, the oos average is not centered at the expected difference in the mse of the pseudo-true forecasting models, so Clark and West introduce an adjustment so that their statistic is centered correctly. Be aware that Clark and West's adjustment is provably correct for the fixed or rolling windows when R is small and the benchmark model is not estimated, though Clark and West's (2007) simulations indicate that it performs well for estimated benchmarks for some dgps. See Calhoun (2011) for an asymptotically normal oos statistic that allows the benchmark to be estimated. The function allows users to choose the "recursive" estimation strategy because it is popular in practice, but be careful.

clarkwest_calculation does all of the algebra and clarkwest is a convenient interface to it that calculates the forecasts automatically.

Value

Both functions return the same thing, a list with elements

mu

an estimate of the corrected oos mean,

avar

the asymptotic variance of the corrected oos average,

pvalue

the p-value associate with the one-sided oos test.

Author(s)

Gray Calhoun galhoun@iastate.edu

References

Calhoun, G. 2011, An asymptotically normal out-of-sample test of equal predictive accuracy for nested models. Unpublished manuscript.

Calhoun, G. 2011, Documentation appendix: An asymptotically normal out-of-sample test of equal predictive accuracy for nested models. Unpublished manuscript.

Clark, T. E., West, K. D. 2006, Using out-of-sample mean squared prediction errors to test the martingale difference hypothesis. Journal of Econometrics, 135(1): 155–186.

Clark, T. E., West, K. D. 2007, Approximately normal tests for equal predictive accuracy in nested models. Journal of Econometrics, 138(1): 291–311.

See Also

dmw_calculation, mixedwindow, mccracken_criticalvalue, recursive_forecasts, predict

Examples

1
2
3
4
5
6
7
8
x <- rnorm(100)
d <- data.frame(y = x + rnorm(100), x = x)
R <- 70

model1 <- function(d) lm(y ~ 1, data = d)
model2 <- function(d) lm(y ~ x, data = d)

clarkwest(model1, model2, d, R, window = "rolling")

grayclhn/oosanalysis-R-library documentation built on May 17, 2019, 8:33 a.m.