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]
Re: st: Re: Out of sample predictions and removing seasonal adjustments using ARIMA and predict
From
Richard Herron <[email protected]>
To
[email protected]
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
<[email protected]> 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/