I would like to do a rolling window forecast with EGARCH model. The following code:
Code: Select all
wfopen 28.csv
series logr = dlog(abs(prc)/cfacpr)
series true_vol = logr^2
series forecasted_garch4
scalar estimation_window = 400
scalar length = @obsrange
for !i=estimation_window to length-2
smpl @first+!i-estimation_window @first+!i
equation kamo4.ARCH(egarch) logr
smpl @first+!i+1 @first+!i+1
kamo4.forecast r se var
forecasted_garch4(!i+2)=var(!i+2)
next
smpl @first+estimation_window+1 @last
scalar num_obs = @obssmpl
scalar RMSE= @sqrt((@sumsq(forecasted_garch4-true_vol))/num_obs)
works for most of the stocks (27 out of 30), but for three of them it gives the following error message:
Overflow in "do_kamo4.forecast r se var"
could you please fix this problem?