Hi,
I am trying to perform the Diebold-Mariano (DM) test on monthly data for several different forecasters. The problem is that the forecasters publish their forecasts at different times each year. I want to calulate the DM-statistic for the forecasts made in, say, March and April and also include the situations where one forecaster publish in March and the other in April. In the following code the DM-statistic is only calculated between same months (March vs March and April vs April).
Smpl 2000 2014 If @Month=3 Or @Month=4
%z="y x z" 'A list of different forecasters
For %z1 {%z}
For %z2 {%z}
If %z1 <> %z2 Then
Equation dm_{%z1}_{%z2}_gdp.ls(n) gdp{%z1}t0_diff_quad-gdp{%z2}t0_diff_quad c
!d_{%z1}_{%z2}=dm_{%z1}_{%z2}_gdp.@Pval(1)
!d_{%z1}_{%z2}_c=dm_{%z1}_{%z2}_gdp.@coefs(1)
EndIf
Next
Next
Any ideas on how to match forecasts made at different months is gratefully acknowledged.
Diebold-Mariano test
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Diebold-Mariano test
How can you detect whether a forecast in March lines up with one made in April?
Re: Diebold-Mariano test
Well, that is really my question. I have a workfile with forecast errors for different months I want EViews to treat forecasts made at, say March and April, as equal so that a DM-test can be carried out (without a bunch of NA´s). Thanks!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Diebold-Mariano test
How does EViews know when the forecast was made?
Re: Diebold-Mariano test
Hi again,
I enclose a sample of the workfile, here containing squared forecast errors of two different forecasters. Forecaster 1 published the first forecast in March 1997 and Forecaster 2 in April 1997. I want Eviews to match them together, i.e. so that it does not matter whether they publish in March or April. The null hypothesis is that the forecasting ability in March and April of the two forecasters is equal.
Thanks again for your help!
I enclose a sample of the workfile, here containing squared forecast errors of two different forecasters. Forecaster 1 published the first forecast in March 1997 and Forecaster 2 in April 1997. I want Eviews to match them together, i.e. so that it does not matter whether they publish in March or April. The null hypothesis is that the forecasting ability in March and April of the two forecasters is equal.
Thanks again for your help!
- Attachments
-
- DM_test.wf1
- (1.86 MiB) Downloaded 301 times
Re: Diebold-Mariano test
Then use lags/leads. For instance, forecaster_1(-1) and forecaster_2 would match as of April.
Re: Diebold-Mariano test
Thanks Trubadur! I am afraid though that will not work on occasions when both forecasters publish the same month. Thanks again!
Re: Diebold-Mariano test
Yes, that may be. But you can use if statements in that cases. I really did not think this thorough, but there may not be a general solution after all.
Who is online
Users browsing this forum: No registered users and 1 guest
