how to forecast level and CIs from difference eq using RATS
Posted: Sat Jun 02, 2012 8:29 am
Hi All,
I was wondering any one knows how to fix the following problem:
I tried to get some level forecasts out of the differenced forecast numbers without much success so far. The following is my simple program:
Quarterly data set is from 1950:1 to 2010:4
diff LogA / DLogA
diff LogB / DLogB
diff LogC / DLogC
diff LogD / DLogD
linreg(define=eq_DLogA,ROBUST,LAGS=2,LWINDOW=NEWEY)
DLogA / Res_ DLogA
# constant $
DLogA {1 2 3 4 } $
DLogB {1 2 3 } $
DLogC {0 1 2 3 } $
DLogD {0 1 2 3 }
FORECAST(FROM=2010:1,steps=10,STDERRS=Error_DLogA, nostatic)
# eq_DLogA DLogA
equation(identity, coeffs=||1.0,1.0||) LogA_ID LogA
# DLogA LogA{1}
set lower = DLogA+Err_DLogA(1)*%invnormal(0.025)
set upper = DLogA+Err_DLogA(1)*%invnormal(0.975)
print / LogA DLogA lower upper Error_DLogA
All the forecasts can be computed except LogA (the level of DLogA), which does not have any forecast values (all NAs).
I was wondering whether someone could kindly point out which part of the code is not right and any example code will be greatly appreciated.
In addition, is it possible to also compute standard errors for the LogA (the level) as well so that I can construct the confidence intervals for the LogA forecasts.
Thank you very much in advance!
Regards
I was wondering any one knows how to fix the following problem:
I tried to get some level forecasts out of the differenced forecast numbers without much success so far. The following is my simple program:
Quarterly data set is from 1950:1 to 2010:4
diff LogA / DLogA
diff LogB / DLogB
diff LogC / DLogC
diff LogD / DLogD
linreg(define=eq_DLogA,ROBUST,LAGS=2,LWINDOW=NEWEY)
DLogA / Res_ DLogA
# constant $
DLogA {1 2 3 4 } $
DLogB {1 2 3 } $
DLogC {0 1 2 3 } $
DLogD {0 1 2 3 }
FORECAST(FROM=2010:1,steps=10,STDERRS=Error_DLogA, nostatic)
# eq_DLogA DLogA
equation(identity, coeffs=||1.0,1.0||) LogA_ID LogA
# DLogA LogA{1}
set lower = DLogA+Err_DLogA(1)*%invnormal(0.025)
set upper = DLogA+Err_DLogA(1)*%invnormal(0.975)
print / LogA DLogA lower upper Error_DLogA
All the forecasts can be computed except LogA (the level of DLogA), which does not have any forecast values (all NAs).
I was wondering whether someone could kindly point out which part of the code is not right and any example code will be greatly appreciated.
In addition, is it possible to also compute standard errors for the LogA (the level) as well so that I can construct the confidence intervals for the LogA forecasts.
Thank you very much in advance!
Regards