Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

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

From |
Nick Cox <njcoxstata@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: Re: st: Out-of-sample forecasting using OLS regression |

Date |
Wed, 22 Aug 2012 09:40:56 +0100 |

If you can give code actually typed and show what Stata does in return, and tell us enough about the data that we can see for ourselves -- ideally can reproduce your results -- then there's the possibility of an explanation. Otherwise this boils down to "but it didn't work for me" to which the answer can only be "something is different in the data or code you have, but we can't see either". Please do look at the Statalist FAQ, especially http://www.stata.com/support/faqs/resources/statalist-faq/#stata Nick On Wed, Aug 22, 2012 at 4:05 AM, Edin Zoronjic <edinvz@gmail.com> wrote: > Dear Mr. Baum, > > I would like to express my gratitude to your patience and help in my case. > > I did run example which you have provided me with and everything > worked well. But when I have tried with my own data it didn't work > (because for the out-of-sample period instead of data all the > observations were filled with dots), then I've decided to input random > data for periods of forecast and repeated the procedure which you have > suggested and Stata generated predicted values for out-of-sample > observations. > > Thank you very much one more time. I really appreciate your help. > > > Best regards, > > Edin Zoronjic > > On 21 August 2012 13:14, Christopher Baum <kit.baum@bc.edu> wrote: >> <> >> On Aug 21, 2012, at 2:33 AM, Edin wrote: >> >>> Basically, it is forecasting using OLS. But using factors estimated by >>> principal component, based on large number of series in the literature >>> (Stock and Watson, Forni et al) is referred as Dynamic factor model >>> forecasting. >>> >>> But, it does not really mater how we call it. What I am interested in >>> is whether I can perform the forecast for the period for which data is >>> not included in the data set, as I have done for ARIMA forecast >>> (without factors). >>> >>> As my work is based on the data of transition economy, the span and >>> the length of available series are very limited. Therefore, I would >>> not like to lose any observations. >>> >>> I would like to do the forecast based on the model which is estimated >>> using the available data. And then, I can compare the ARIMA and the >>> DFM forecast with actual values (which are available for the variable >>> of interest, while the data on other series used in estimation of >>> factors are not available). >>> >>> I am really sorry for bothering you, but I do believe that there is a >>> way to do the forecast for future period. And that is why I do not >>> understand why Stata does not generate predicted values for the future >>> period. >> >> Did you run the example I provded in my prior email?!? It does exactly that: produces dynamic forecasts beyond the >> end of the estimation sample period. The series cpihat_d beyond 2008q4 does not depend on having any values for >> cpi available. >> >> This variation will demonstrate that. cpi is set to missing beyond the estimation sample, but Stata >> can still produce dynamic forecasts through the end of the available data on the RHS variables. >> >> use http://fmwww.bc.edu/cfb/data/usmacro1,clear >> arima cpi l.cpi d.oilprice d.wage if tin(, 2008q4) >> replace cpi = . if tin(2009q1,) >> predict double cpihat_s if tin(2006q1,), y >> predict double cpihat_d if tin(2006q1,), dynamic(tq(2008q4)) y >> l year qtr cpi* if !mi(cpihat_d) >> * * 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/

**References**:**Re: Re: st: Out-of-sample forecasting using OLS regression***From:*Christopher Baum <kit.baum@bc.edu>

**Re: Re: st: Out-of-sample forecasting using OLS regression***From:*Edin Zoronjic <edinvz@gmail.com>

- Prev by Date:
**Re: st: Missing Observations. Do I need multiple Imputations?** - Next by Date:
**Re: st: Missing Observations. Do I need multiple Imputations?** - Previous by thread:
**Re: Re: st: Out-of-sample forecasting using OLS regression** - Next by thread:
**Re: Re: Re: st: Out-of-sample forecasting using OLS regression** - Index(es):