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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: Re: Out of sample predictions and removing seasonal adjustments using ARIMA and predict


From   Richard Herron <richard.c.herron@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: Out of sample predictions and removing seasonal adjustments using ARIMA and predict
Date   Wed, 14 Sep 2011 20:16:13 -0400

I should not have -if tin()- in the -predict- command. The correct solution is:

* begin code
webuse friedman2, clear
tsappend, last(2000q4) tsfmt(tq) // add observations
generate l_m1 = log(m1)
arima DS4.l_m1, ar(1) ma(4) noconstant
predict p_l_m1, y dynamic(q(1998q3))
generate p_m1 = exp(p_l_m1)
* end code

On Sun, Sep 11, 2011 at 16:47, Richard Herron
<richard.c.herron@gmail.com> wrote:
> The final pieces are:
>
> (1) make the series stationary "on the fly" with _S4_ and _D_ so that
> I can use _predict_ to get back the original series
>
> (2) use _, y_ so that _predict_ returns the prediction in levels.
>
> Here's the complete solution:
>
> * begin code
> webuse friedman2, clear
> tsappend, last(2000q4) tsfmt(tq) // add observations
> generate l_m1 = log(m1)
> arima DS4.l_m1, ar(1) ma(4) noconstant
> predict p_l_m1 if tin(1998q4, 2000q4), y dynamic(q(1998q3))
> generate p_m1 = exp(p_l_m1)
> * end code
>
*
*   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