johntwk/Diebold-Mariano-Test

ZeroDivisionError: 0.0 cannot be raised to a negative power

ahbon123 opened this issue · 1 comments

Sorry,

It raises the following error while I running DM test:

 DM_stat=V_d**(-0.5)*mean_d
ZeroDivisionError: 0.0 cannot be raised to a negative power

Could you help to handling this? Thanks.

It means that your variance estimate, V_d, is zero. According to the paper, in rare cases this can happen (negative or zero variance estimate). In this case you should simply immediately reject the null hypothesis.