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: st: ma(1) model, cannot explain the predicted values


From   Tirthankar Chakravarty <tirthankar.chakravarty@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: ma(1) model, cannot explain the predicted values
Date   Sun, 20 Nov 2011 13:11:00 -0800

You are right about what the MA(1) model is. But you have not taken
into consideration that the error process is not observed. In order to
construct predicted values of Y(t), you have to construct estimates of
the errors based on your time 't' information set. Specifically,

* estimate of e(t) given I(t) = 0
* estimate of e(t-1) given I(t) = Y(t-1) - prediction of Y(t-1). The
prediction of Y(t-1) is constructed recursively starting from the
initial condition:
(1) predicted value of Y(1) = _b[_cons],
    ==> predicted value of e(1) = Y(1) - predicted value of Y(1).
(2)  predicted value of Y(2) = _b[_cons] + _b[ARMA:L.ma]*(predicted
value of e(1))
    ==> predicted value of e(2) = Y(2) - predicted value of Y(2)
...
and so on recursively, where I(t) denotes the sigma-algebra generated
by (Y(t-1), Y(t-2), ...).

Hope this is clear. Else, you can look up any standard textbook on
time series analysis, for example, James Hamilton's Time Series
Analysis (Princeton, 1994).

T

On Sun, Nov 20, 2011 at 7:20 AM,  <corn@mail.tu-berlin.de> wrote:
> Thanks for your answer, but I don't understand, what
> g man_prede=_b[_cons]
> replace man_prede = _b[ARMA:L.ma]*(L.D.wpi-L.man_prede) ///
>        + _b[_cons] in 3/l
> does?
>
> well, it creates the variable man_prede with the constant term. Ok, then it
> replaces for each value with the coef.*(lag of the variable minus the
> predicted value)  plus the constant term?
> Mh, I don't get it.
>
> I thought the normal ma(1) model is:
> y(t)= constant + e(t) + coef.*e(t-1) ?
>
> Zitat von Tirthankar Chakravarty <tirthankar.chakravarty@gmail.com>:
>
>> You haven't taken care of the initial conditions in your predictions.
>> The following example shows you how to construct the predictions
>> manually in the way that Stata does. This uses the fact that the
>> unconditional prediction is the  the estimate of the intercept:
>>
>> **********************************
>> webuse wpi1, clear
>> arima D.wpi,  ma(1)
>> predict stata_pred, xb
>> g man_prede=_b[_cons]
>> replace man_prede = _b[ARMA:L.ma]*(L.D.wpi-L.man_prede) ///
>>        + _b[_cons] in 3/l
>> li
>> **********************************
>>
>> T
>>
>> On Sun, Nov 20, 2011 at 1:59 AM,  <corn@mail.tu-berlin.de> wrote:
>>>
>>> Hello,
>>> I want understand ma(q) processes. Thats why I made up an example for
>>> myself. I have one time series variable called SIE with 20 values (from
>>> 08.10.2002 up to 04.11.2002) and the a corresponding variable with time
>>> data.
>>> first, I type
>>>
>>> tsset time
>>> (time is my time variable)
>>>
>>> then I want a ma(1) model, so I type
>>> arima SIE, ma(1)
>>>
>>> I get an output, which says that my coef. of the constant is 41.72032 and
>>> my
>>> coef. of my maL1. is 1.
>>>
>>> Now, I want to have a look at the values, so I type
>>> predict values, xb
>>> predict residuen, residuals
>>>
>>> and the list
>>> and my proplem now is: I want to control these values by calculating them
>>> by
>>> myself:
>>> The first values of SIE are:
>>> 08.10.2002 32.05
>>> 09.10.2002 32.42
>>>
>>> the predicted values (variable "values") are
>>> 08.10.2002 41.72032
>>> 09.10.2002 36.88516
>>>
>>> and the residuals
>>>
>>> 08.10.2002 -9.670321
>>> 09.10.2002 -4.465162
>>>
>>> now I tried to calculate:
>>> I thought ma(1) means:
>>> y(1) = constant +e(1)+coef.*e(0) = 41.72032 + (-9.670321) + 1*0= 32.05
>>> ok this works, now y(2):
>>> y(2) = constant + e(2)+coef.*e(1)
>>> so y(2) = 41.72032 + -4.465162 + 1*-9.670321 but this is not 36.88516 ?
>>> Please, can you explain, how to get the value 36.88516? I dont see it....
>>>
>>> Thanks a lot!
>>>
>>> *
>>> *   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/
>>>
>>
>>
>>
>> --
>> Tirthankar Chakravarty
>> tchakravarty@ucsd.edu
>> tirthankar.chakravarty@gmail.com
>>
>> *
>> *   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/
>>
>>
>
>
>
> *
> *   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/
>



-- 
Tirthankar Chakravarty
tchakravarty@ucsd.edu
tirthankar.chakravarty@gmail.com

*
*   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