Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | kristian@hefting.dk |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Disabling Kalman filter in arima |
Date | Thu, 16 Sep 2010 15:35:55 +0200 |
Hi Maarten and everybody else Thanks for your answer. I should have been more specific. My problem is in the start of the dataset with e.g. a MA(1)-model: Y(t)=B0+B1*u(t-1)+u(t), where u(t)=Y(t)-predicted Y(t) If I estimate this model I obtain some estimates for B0 and B1. If I want to obtain a predicted value for the first value of Y in my dataset - Y(0) - I need some value for u(0-1). I would prefer to put u(0-1)=0 (both when I estimate the equation and when I later use it for predictions) but Stata does it different. It assigns some value to u(0-1) (even though Y(0-1) and predicted Y(0-1) is unobserved) and my guess is that it uses the Kalman filter to obtain this value. Because of this I want to turn of the Kalman filter (or anything that would make Stata set u(0-1)=0 during estimation and prediction). Hope somebody can help! > --- On Thu, 16/9/10, kristian@hefting.dk wrote: >> Stata uses a Kalman filter to replace missing/unobserved >> data when fitting an arima model. Is there any way to >> disable this filter so the missing/unobserved data is >> treated as zeros? > > As you can see in the example below -arima- just drops > observations with missing values, rather than replace > their values (look at the number of observations used). > That is the default for (almost) all Stata programs. > > *--------- begin example ----------- > webuse wpi1, clear > arima wpi, arima(1,1,1) > replace wpi = . in 10 > arima wpi, arima(1,1,1) > *--------- end example ------------- > > Replacing missing values manually with a fixed value is > usualy very bad practice, unless you have information that > a missing value is just an odd way that your data collectors > used for storing a 0. In that case you can just correct > your data by typing: > > replace <variable_name> = 0 if <variable_name> == . > > Otherwise I would just stick with the Stata default. > > Hope this helps, > Maarten > > -------------------------- > Maarten L. Buis > Institut fuer Soziologie > Universitaet Tuebingen > Wilhelmstrasse 36 > 72074 Tuebingen > Germany > > http://www.maartenbuis.nl > -------------------------- > > > > > * > * 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/