Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: Re: st: Out-of-sample forecasting using OLS regression


From   Christopher Baum <kit.baum@bc.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   re: Re: st: Out-of-sample forecasting using OLS regression
Date   Tue, 21 Aug 2012 01:45:10 +0000

<>
Edin said

I do dynamic factor model as it follows:

First of all I generate factors using factor analysis function which
is available in Stata.
Secondly, I save two factors in my data set as new variables.
Thirdly, I run following regression (ARIMA or OLS):

cpi = c + l.cpi + factor1 + factor2...

OK, so it is just OLS, with a desire to perform a dynamic forecast ex ante. The following will do that, and contrast it with the static (one-period-ahead) forecast. In the dynamic forecast, the past value of l.cpi generated by the model will be used after the end of the estimation sample, rather than the historical value. (OK, I know this equation is dynamically unstable, but it is merely illustrative).

use http://fmwww.bc.edu/cfb/data/usmacro1,clear
arima cpi l.cpi d.oilprice d.wage if tin(, 2008q4)
predict double cpihat_s if tin(2006q1,), y
predict double cpihat_d if tin(2006q1,), dynamic(tq(2008q4)) y
tsline cpihat_s cpihat_d if !mi(cpihat_s)

Kit


Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
                             An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
  An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index