Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: How to let Arch give out of sample prediction??


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: How to let Arch give out of sample prediction??
Date   Thu, 5 May 2005 09:41:02 -0500

Do you have observations for variable x beyond 1990?  If so then -predict-
should give you out of sample predictions.  In general, -predict- calculates
the requested statistic for all possible observations, whether they were
used in the model or not.

In the example below, the model is estimated on data up to 1980q1, but the
predicted values go to 1990q4.

. use http://www.stata-press.com/data/r9/wpi1.dta, clear


. arch ln_wpi if tin(,1980q1), arch(1) garch(1) nolog
BFGS stepping has contracted, resetting BFGS Hessian (0)

ARCH family regression

Sample:  1960q1 to 1980q1                   Number of obs      =        81
                                            Wald chi2(.)       =         .
Log likelihood =  85.18144                  Prob > chi2        =         .

----------------------------------------------------------------------------
--
             |                 OPG
      ln_wpi |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
ln_wpi       |
       _cons |   3.423398   .0011066  3093.53   0.000     3.421229
3.425567
-------------+--------------------------------------------------------------
--
ARCH         |
        arch |
         L1. |   1.137414    .630359     1.80   0.071    -.0980673
2.372895
       garch |
         L1. |   .0000419   .1747459     0.00   1.000    -.3424538
.3425376
       _cons |   7.66e-06   3.41e-06     2.25   0.025     9.76e-07
.0000144
----------------------------------------------------------------------------
--

. predict y, y

. l in -5/l

     +--------------------------------------+
     |   wpi        t     ln_wpi          y |
     |--------------------------------------|
120. | 109.4   1989q4   4.695011   3.423398 |
121. |   111   1990q1    4.70953   3.423398 |
122. | 110.8   1990q2   4.707727   3.423398 |
123. | 112.8   1990q3   4.725616   3.423398 |
124. | 116.2   1990q4   4.755313   3.423398 |
     +--------------------------------------+

Scott

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of F. Gao
> Sent: Wednesday, May 04, 2005 10:20 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: How to let Arch give out of sample prediction??
> 
> Dear all,
> 
> I am using arch command to estimate a time series for a subset of
> years, and hoping to get predicted values for fitted values as well as
> the conditional variance out of sample (after 1990). I only get the
> in-sample predictions somehow. Here is what I did
> 
> arch y x if year<1990, archm arch(1) garch(1)
> 
> predict yhat
> 
> predict cond_var, variance
> 
> Can anyone tell me why the last two commands would not give out of
> sample predicitons? Thanks!
> 
> Faye Gao
> 
> *
> *   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