dm_test: Diebold-Mariano Test

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

Description

Performs the Diebold-Mariano test for equal predictive performance of two methods with respect to a scoring rule.

Usage

1
dm_test(s1, s2, alternative = c("two.sided", "less", "greater"), h = 1)

Arguments

s1

Score from method 1.

s2

Score from method 2.

alternative

A character string specifying the alternative hypothesis, must be one of 'two.sided' (default), 'greater' or 'less'.

h

An integer specifying the smallest lag not used in the autocovariance function.

Details

The null hypothesis is that the difference s1 - s2 has zero mean. The alternative 'less' is that s1 - s2 has negative mean.

The test statistic requires values of the autocovariance function of s1 - s2 with lags smaller than h, i.e. lag.max = h - 1 (the truncation lag) in acf.

The difference s1 - s2 may contain missing values, in which case complete cases are used and a warning is given.

Value

A object of class 'htest'.

Note

The function dm_test is inspired by the function dm.test from package forecast. It is a 'simpler' version in the sense that it computes p-values from the normal instead of the t distribution.

Author(s)

J. Gross, A. Moeller.

References

Diebold F.X, Mariano R.S. 1995. Comparing predictive accuracy. Journal of Business & Economic Statistics, 13, 253–263.

Gneiting T., Katzfuss M. 2014. Probabilistic forecasting. Annual Review of Statistics and Its Application, 1, 125–151.

See Also

dm.test in package forecast.

Examples

1
2
3
4
set.seed(1)
s1 <- arima.sim(list(ar = 0.7), sd = 0.5, 100)
s2 <- arima.sim(list(ar = 0.7), sd = 0.5, 100) - 0.1
dm_test(s1, s2)

JuGross/ensAR documentation built on May 10, 2019, 8:23 a.m.