Python Implementation of dm.test (Diebold Mariano) from R's Forecast Package with the same interface

Viewed 1647

I was in need of the exact interface and output of the forecast package's dm.test() function to reproduce some results of work that I'm translating from R to Python. Surprisingly a simple google and deep dive in statsmodels API did not turn up any results, I'm wondering if it exists under a different naming convention system or library.

I did find an open source implementation here : https://github.com.cnpmjs.org/johntwk/Diebold-Mariano-Test but it does not have the exact interface, particularly the parameter to specify an alternative Hypothesis in the R function. There might be a small chance that I'm missing something in common due to my lack of background in statistics.

1 Answers

UPD: the test you found indeed returns two-sided p-value. (See the pic) code proof

I did not dive into the problem, but it's highly unlikely that someone would implement a one-way test, not specifying the default alternative hypothesis.

So I guess the test is two-sided without any other options.

(Not trying to post a complete answer, that's just my opinion)

Related