I would like to calculate prediction intervals from recursive forecasts (small sample), is this the correct method?
Code: Select all
clear yhat_r_model2
clear dfs
clear dfs1
do regend = ibegin, iend
linreg(define=eqmodel2,print) y istart regend
# constant x1{1} x2{1} x3{1}
uforecast(equation=eqmodel2,from=regend+1,steps=1,stderrs=stderrs) yhat_r_model2
set dfs regend iend = %ndf
end do regend
set dfs1 ibegin+1 iend+1 = dfs{1}
prin / y dfs dfs1 yhat_r_model2 stderrs
set lower95 ibegin+1 iend+1 = yhat_r_model2+%invtcdf(.025,dfs1)*stderrs
set upper95 ibegin+1 iend+1 = yhat_r_model2+%invtcdf(.975,dfs1)*stderrs
prin / y yhat_r_model2 lower95 upper95
Code: Select all
prj(stderrs=stderrs) yhat_r_model2 regend+1 regend+1
many thanks,
Amarjit