Diebold_Mariano Test
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
Diebold_Mariano Test
Hello,
Would anyone have an EViews code to produce the Diebold-Mariano Predictive Accuracy Test (Diebold, F.X. and R. S. Mariano, "Comparing Predictive Accuracy", J. Bus and Ec Stat, Vol. 13, No. 3, July 1995)?
Regards
Donihue
Would anyone have an EViews code to produce the Diebold-Mariano Predictive Accuracy Test (Diebold, F.X. and R. S. Mariano, "Comparing Predictive Accuracy", J. Bus and Ec Stat, Vol. 13, No. 3, July 1995)?
Regards
Donihue
Re: Diebold_Mariano Test
Hi donihue
In its simple form, the DM test can be calculated by regressing the difference of the loss functions (squared or absolute error) on a constant using Newey-West standard errors
However, be aware of certain limits of the DM test. For the small sample bias correction, check
Harvey, Leybourne and Newbold, "Testing the equality of prediction mean squared errors", 1998
and for a more general discussion, check e.g.
Giacomini and White, "Tests of Conditional Predictive Ability", 2006
Best
Savy
In its simple form, the DM test can be calculated by regressing the difference of the loss functions (squared or absolute error) on a constant using Newey-West standard errors
Code: Select all
'fc1: Forecast 1
'fc2: Forecast 2
'r: Realised Data
' MSE
es_fc1 = (fc1 - r)^2
es_fc2 = (fc2 - r)^2
genr d_squaredloss = es_fc1 - es_fc2
' MAE
ea_fc1 = @abs(fc1 - r)
ea_fc2 = @abs(fc2 - r)
genr d_absloss = ea_fc1 - ea_fc2
' DM test
equation dm_squaredloss.ls(n) d_squaredloss c
equation dm_abs.ls(n) d_absloss c
However, be aware of certain limits of the DM test. For the small sample bias correction, check
Harvey, Leybourne and Newbold, "Testing the equality of prediction mean squared errors", 1998
and for a more general discussion, check e.g.
Giacomini and White, "Tests of Conditional Predictive Ability", 2006
Best
Savy
Re: Diebold_Mariano Test
Many thanks, Savy. That is very helpful indeed.
Regards
Donihue
Regards
Donihue
Re: Diebold_Mariano Test
I am trying to use this code for the DM test but I get the error as in the image...
Could you help me?
Could you help me?
- Attachments
-
- dmtest.jpg (95.39 KiB) Viewed 20207 times
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Diebold_Mariano Test
Put a genr in front of the line that sets them.
Follow us on Twitter @IHSEViews
Re: Diebold_Mariano Test
Thanx Gareth,
I 've done what you said, I pressed run without having any errors but I do not get any results...
Do I have to do something else to see the results?
I 've done what you said, I pressed run without having any errors but I do not get any results...
Do I have to do something else to see the results?
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Diebold_Mariano Test
I don't know enough about the test to say what the results should be. The code generates an equation object, which will be in your workfile. Which of the equation results you need to look at though, I don't know. I'm sure you can figure that bit out though.
Follow us on Twitter @IHSEViews
Re: Diebold_Mariano Test
Dear Gareth, the problem is that I do not get the workfile either...
any ideas why? this is my data
when I press run and I get a new box 'run program' I should just press 'ok' right?
Sorry if the questions are stupid, I am quite a rookie...
any ideas why? this is my data
when I press run and I get a new box 'run program' I should just press 'ok' right?
Sorry if the questions are stupid, I am quite a rookie...
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Diebold_Mariano Test
Your screenshot clearly indicates that you have a workfile open.
Follow us on Twitter @IHSEViews
Re: Diebold_Mariano Test
Excuse me bad writing, I meant I do not get the new object into the workfile!
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13318
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Diebold_Mariano Test
You should have an equation object called dm_squaredloss and one called dm_abs
Follow us on Twitter @IHSEViews
Re: Diebold_Mariano Test
Sorry I run it, I do not get any errors but nothing is added in my workfile... Strange?
-
- Posts: 13
- Joined: Thu Mar 27, 2014 9:17 am
Re: Diebold_Mariano Test
I did run the test and had the results. I think the result is not valid enough . t statistic. please find attached.
- Attachments
-
- aexorg.wf1
- (562.27 KiB) Downloaded 477 times
-
- Posts: 13
- Joined: Thu Mar 27, 2014 9:17 am
Re: Diebold_Mariano Test
please give me some attention
Who is online
Users browsing this forum: No registered users and 58 guests