dm.test | R Documentation |
This function performs the Diebold-Mariano-Test for equal predictive performance of two forecasts with respect to a scoring rule.
This test computes p-values from the normal distribution instead of the student-t distribution, as in dm.test
.
dm.test(
s1,
s2,
alternative = c("two.sided", "less", "greater"),
h = 1,
na.action = na.omit
)
s1 |
vector of scores from method 1 |
s2 |
vector of scores from method 2 |
alternative |
character; the alternative
hypothesis and must be one of " |
h |
integer; forecast horizon used in calculating s1 and s2; default: 1 |
na.action |
function to handle the NA's. Default: The null hypothesis is that the difference The difference |
An object of class htest
.
The function dm.test
is inspired by the function dm_test
from the R-package ensAR
by J. Gross and A. Moeller.
David Jobst
Diebold, F. and Mariano, R. (1995). Comparing predictive accuracy. Journal of Business & Economic Statistics, 13, 253-263.
Gneiting, T. and Katzfuss, M. (2014). Probabilistic forecasting. Annual Review of Statistics and Its Application, 1, 125-151.
# simulated data
s1 <- arima.sim(list(ar = 0.7), sd = 0.5, 100)
s2 <- arima.sim(list(ar = 0.7), sd = 0.5, 100) - 0.2
# Diebold-Mariano-Test
dm.test(s1, s2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.