how to forecast level and CIs from difference eq using RATS

Questions and discussions on Time Series Analysis

how to forecast level and CIs from difference eq using RATS

Postby anozman » 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
anozman
 
Posts: 23
Joined: Mon Jan 30, 2012 6:16 pm

Re: how to forecast level and CIs from difference eq using R

Postby anozman » Sat Jun 02, 2012 8:36 am

sorry, there are two typos:

set lower = DLogA+Errror_DLogA(1)*%invnormal(0.025)
set upper = DLogA+Error_DLogA(1)*%invnormal(0.975)
anozman
 
Posts: 23
Joined: Mon Jan 30, 2012 6:16 pm

Re: how to forecast level and CIs from difference eq using R

Postby TomDoan » Sun Jun 03, 2012 9:25 am

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}

doesn't incorporate the identity into the forecasts. You need to define the identity first, then include it in the FORECAST instruction, that is:

equation(identity, coeffs=||1.0,1.0||) LogA_ID LogA
# DLogA LogA{1}
FORECAST(FROM=2010:1,steps=10,STDERRS=Error_DLogA, nostatic) 2
# eq_DLogA DLogA
# loga_id LogA
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: how to forecast level and CIs from difference eq using R

Postby anozman » Sun Jun 03, 2012 4:40 pm

Thank you very much Tom, appreciate your help! :D
anozman
 
Posts: 23
Joined: Mon Jan 30, 2012 6:16 pm

Re: how to forecast level and CIs from difference eq using R

Postby anozman » Mon Jun 04, 2012 1:38 am

Hi Tom,

the program runs nicely. Could you please tell me whether the second error term - Error_DlogA(2) reported based on PRINT instruction is in fact related to logA, as it is the second equation included in the forecast insttruction?

Many thanks
anozman
 
Posts: 23
Joined: Mon Jan 30, 2012 6:16 pm

Re: how to forecast level and CIs from difference eq using R

Postby TomDoan » Mon Jun 04, 2012 7:53 am

anozman wrote:Hi Tom,

the program runs nicely. Could you please tell me whether the second error term - Error_DlogA(2) reported based on PRINT instruction is in fact related to logA, as it is the second equation included in the forecast insttruction?

Many thanks


Yes. It will be the standard errors of forecast of the logA. Those should be increasing with horizon.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: how to forecast level and CIs from difference eq using R

Postby anozman » Mon Jun 04, 2012 5:12 pm

Thank you very much Tom, much appreciated! :lol:
anozman
 
Posts: 23
Joined: Mon Jan 30, 2012 6:16 pm


Return to Other Time Series Analysis

Who is online

Users browsing this forum: No registered users and 1 guest