Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: ARMA forecasting


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: ARMA forecasting
Date   Mon, 26 Feb 2007 15:39:17 -0600

Your one-step-ahead forecasts by hand are incorrect.

If y_t = b_0 + e_t; e_t = rho*e_t-1 + v_t

Then the forecast for time t is

y_t = b_0 + rho*(y_t-1 - b_0)


For example:

sysuse auto,clear
gen t =_n
tsset t
arima mpg , ar(1)
predict xb,xb
gen foo =[ARMA]_b[L1.]*(l.mpg- _b[_cons])+ _b[_cons]
l t mpg xb  foo in 1/10

Scott


> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of da2147@columbia.edu
> Sent: Sunday, February 25, 2007 6:00 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: ARMA forecasting
> 
> Hello all
> 
> I'm trying to fit some ARMA models to some time-series data I have
> and trying to make one-step-ahead forecasts with the following
> commands:
> 
> arima x, arima(1,0,0) //a simple AR(1) model
> predict xhat, xb
> 
> Suppose the constant is estimated to be .4 and the autoregressive
> parameter is estimated to be .25; now I want to calculate
> one-step-ahead predictions and thats what I think I'm using the
> <predict> command for. However, the <xhat> I get by using the
> <predict> command doesnt tie in with my notion of what the
> predicted values should be. For example, (from my limited knowledge
> of time series), I think
> 
> E(x1 | x0) should just be = .4
> E(x2 | x1, x0) should be = .4 + (.25*x1)
> E(x3 | x2, x1, x0) should be = .4 + (.25*x2) and so on
> 
> (Note: these are just in-sample one-step-ahead forecasts. My actual
> time series is 40 observations long and the parameter estimates
> given above are for AR estimation done on the entire 40
> observations.)
> 
> However, the stata outputs for <xhat> using the predict command dont
> match up with the above.
> 
> I'm quite puzzled about this. Any help would be much appreciated.
> 
> Thanks
> divya
> 
> 
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index