# Difference between h and T in Harvey-adjusted Diebold and Mariano test?

I am looking into comparing the predictive accuracy of forecasts of different models against a benchmark model. For this I have looked into the Diebold-Mariano test statistic. However, I am using the modified Harvey, Leybourne and Newbold version of this test and I do not understand the difference between the used T and h in this modification?

The original DM-statistic value is multiplied by the square root of:

[T + 1 - 2h + h(h-1)/T]/T


As far as I can see, the T and h will be equal for h-period forecast and as T being the length of the forecast errors?

$$h$$ is the forecast horizon, whereas $$T$$ is the sample size for the loss differentials.

For example, if I have data $$Y_1, ..., Y_{100}$$, I could construct a sequence of 2-step-ahead forecasts like this:

1. Fit my model on $$Y_1, ..., Y_{90}$$, and derive $$\hat{Y}_{92}$$.
2. Fit my model on $$Y_1, ..., Y_{91}$$, and derive $$\hat{Y}_{93}$$.

...

1. Fit my model on $$Y_1, ..., Y_{98}$$, and derive $$\hat{Y}_{100}$$.

I then evaluate my loss function for each of $$L(Y_i, \hat{Y}_i)$$, for $$i=92,...,100$$. I do the same for my benchmark model and obtain loss differentials $$d_{92},...,d_{100}$$.

In this example, we have $$h=2$$ and $$T=9$$.

• Okey, so h is sort of the time increments of the total forecasted horizon? And, just a question, if you were to do as the example, in e.g. step 3 through 9, would you use Yhat_92 or Y_92 when estimating e.g. Yhat_94? (Sorry, for the math, I don't know how to use math mode here...) Commented May 22, 2020 at 17:05
• $h$ is the number of steps ahead for the forecast, yes. When forecasting for $\hat{Y}_{94}$, you would base it on the actual data up to $Y_{92}$, otherwise it would not be a 2-step-ahead forecast (if you use only $Y_1,...,Y_{90}$, it is a 4-step-ahead forecast). Commented May 23, 2020 at 14:51
• That makes sense, thanks for clarifying. Commented May 23, 2020 at 16:11