Diebold-Mariano Forecast Comparison Test
The Diebold-Mariano test compares the accuracy of two forecasts of the same series by testing whether the mean of their loss differential is zero, using a long-run variance that allows for serially correlated multi-step errors.
Diebold-Mariano 검정은 같은 시계열에 대한 두 예측의 손실 차이 평균이 0인지를, 다단계 예측오차의 자기상관을 허용하는 장기분산으로 검정해 정확도를 비교합니다.
Also known as: Forecast Accuracy Comparison with Small-Sample Correction (HLN)
다른 이름: 소표본 보정 예측 정확도 비교(HLN)
Are my model's forecasts significantly more accurate than the benchmark forecasts?
내 모형의 예측이 기준 예측보다 유의하게 더 정확한가요?
The Diebold-Mariano test forms the difference between the losses of two forecasts at each time point, such as squared or absolute errors, and divides its mean by a standard error that accounts for autocorrelation up to horizon minus one. With the Harvey-Leybourne-Newbold correction the statistic is compared with a t distribution, which improves its behaviour in small samples.
When to use Diebold-Mariano Forecast Comparison Test
- You have actual values and two competing forecast series for the same periods
- You want a formal test of equal predictive accuracy at a given horizon
- Forecast errors may be autocorrelated because forecasts are multi-step
When to use something else
- You want to rank several models by refitting them: use Rolling Origin Forecast Evaluation
- The two forecasts come from nested models estimated on the same data: run the Clark-West option (test = clark_west) rather than the plain DM test
Assumptions and requirements
- The loss differential is covariance stationary
- Forecast horizon h is stated correctly (it sets the autocorrelation lags)
- Enough forecast periods (about 30 or more) for the reference distribution
What the analysis reports
- DM statistic (HLN-corrected) and p-value
- Mean loss of each forecast and their difference
- MAE and RMSE of each forecast
- Clark-West test for nested models (test = clark_west): adjusted loss differential, Newey-West standard error, one-sided statistic and p-value, and the adjusted MSPE of the larger model
How to report it
A Diebold-Mariano test (squared loss, h = [h], HLN-corrected, T = [n]) gave DM = [value], p = [value]; mean loss was [value] for [forecast 1] and [value] for [forecast 2].
Related methods
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with statsmodels and direct computations (formulas, enumeration or simulation) at a stated tolerance of 1e-10.
독립 계산. statsmodels·직접 계산(식·열거·모의실험) 대조 참조 시험 1건 통과(허용오차 1e-10).
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Diebold-Mariano Forecast Comparison Test on Quorant
- Data you need
- a table (CSV or Excel) with a time variable, an outcome variable and predictor (feature) columns
- Price
- 400 credits for one analysis up to 10,000 rows (complexity level 3); larger or wider data costs more. Optional methodologist review: 1800 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.