Why MAE and RMSE are the same

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

chtsy
Posts: 3
Joined: Wed Aug 05, 2015 7:50 am

Why MAE and RMSE are the same

Postby chtsy » Wed Aug 05, 2015 7:58 am

Hello all,

I am doing recursive window to forecast stock return. After obtain predictions, I use RMSE, MAE, MAPE, Theil to evaluate the performance.

But I found that the results of MAE and RMSE are totally the same, and some of Theil value is 1.

I do not know whether these are correct? Could anyone can help me check it.

Code: Select all

%y = "stock" 'y is stock return %x1 = "div2" 'x1 is dividend yield %x2 = "sir" 'x2 is short-term interest rate %x3="ipg" 'x3 is industrial production growth 'stock regression 1 step ahead for !i=0 to 124-1 'estimate the regression 124 times smpl 1980m2 2004m12+!i 'recursive-sample starts at same place 'sample is extended by 1 obs each time equation stkreg1s{!i}.ls {%y} c {%x1}(-1) {%x2}(-1) {%x3}(-1) stkreg1s{!i}.makeresid stkreg1sres smpl 2005m1+!i 2015m04 'set forecast sample stkreg1s{!i}.forecast(f=na) tmp_stkreg1sfcst series stkreg1sfcst stkreg1sfcst = tmp_stkreg1sfcst next 'forecast evaluation %y="stock" scalar mape = @mape(stock, stkreg1sfcst) scalar mae = @mae(stock, stkreg1sfcst) scalar theil = @theil(stock, stkreg1sfcst) scalar RMSE = @rmse(stock, stkreg1sfcst)
By the way, which one of the following two is correct?
scalar RMSE = @rmse(y, yfcst)
scalar RMSE = @rmse(yfcst, y)

Thank you very much!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Why MAE and RMSE are the same

Postby EViews Gareth » Wed Aug 05, 2015 8:21 am

You are computing the forecast evaluation statistics over a single value. That's what causes them to be identical.

For RMSE it doesn't matter which order you put the series in.

chtsy
Posts: 3
Joined: Wed Aug 05, 2015 7:50 am

Re: Why MAE and RMSE are the same

Postby chtsy » Wed Aug 05, 2015 8:32 am

Thanks for your reply.

This is a recursive window forecasting. If I want to forecast 1 step ahead from 2005m01 to 2015m12, then how to modify the program?

Will the forecast in menu have the same result of programming?

Besides that, I use the data from prediction and compare it with actual data and computing RMSE and MAE manually, the result is totally different with the one programming generated. Driven crazy... :cry:

Thanks again.
Last edited by chtsy on Wed Aug 05, 2015 8:37 am, edited 1 time in total.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Why MAE and RMSE are the same

Postby EViews Gareth » Wed Aug 05, 2015 8:36 am

Change the sample before calculating the evaluation statistics.

chtsy
Posts: 3
Joined: Wed Aug 05, 2015 7:50 am

Re: Why MAE and RMSE are the same

Postby chtsy » Wed Aug 05, 2015 8:40 am

The result I obtained from the programming is a little strange, can I do the forecast from the menu after finish the regression. It is much simpler and the result seems to be more satisfied.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Why MAE and RMSE are the same

Postby EViews Gareth » Wed Aug 05, 2015 8:59 am

If you want to.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests