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)
scalar RMSE = @rmse(y, yfcst)
scalar RMSE = @rmse(yfcst, y)
Thank you very much!
