I have two sets of forecasting errors, and want to perform a DM test.
Both forecasts are a fixed size moving window, and are 1 day ahead forecasts.
The first step of performing the DM test is to calculate the difference in loss functions, which I have done. As I understand it, this could be autocorrelated, which affects the standard errors.
Whilst I can calculate standard errors like this: s.e. = sqrt(var(dt)/length(dt)), I believe that, if there is autocorrelation, I need to calculate the standard errors like this: s.e. = sqrt((var(dt)+2*sum(cov))/length(dt)), where cov is a vector of k autocovariances. How do I choose k, which are the number of autocovariance lags? Is there a test to conduct? I have heard about using BIC to calculate this.. How do I do that? I have plotted the autocorrelations and autocovariances with the acf function, but still don't know what to do from here. I have over 1100 forecasted observations if that helps.
if the dm statistic is statistic = (mean(dt) / s.e.), I essentially want to know how the s.e. is calculated.
Guidance is much appreciated!
dm.testfunction in theforecastpackage in R. It follows the paper by Harvey et al. (1997) referenced to in the function's help file. – Richard Hardy Nov 01 '18 at 10:23