Re: A question on time series
- From: dave@xxxxxxxxxxx
- Date: 27 Dec 2006 06:55:33 -0800
MCI wrote:
Suppose I have a time series of 1000 daily observations of random
variable x. I want to see if the standard deviation of change of x is
proportional to level of x, so I construct a rolling window: the window
length is 200, and I roll the window forward by 50, or i define forward
size to be 50 (so the first window contains the data from t =1 to t =
200; the second contains the data from t = 51 to t = 251, etc). Inside
each rolling window, I calculate the mean and the standard deviation,
so for 20 windows I have 20 means and 20 standard deviations, I then
run regression of these 20 standard devations on the 20 means to see
how large is the r-squared.
My question is: it seems the r-squared changes much with the length of
the rolling window and how far I roll the window forward each time. So
what do you think the rolling window and forward size should be?
(should I keep the rolling window length constant and as long as
possible to reduce the standard deviation estimation error? also,
should I keep the forward size as small as possible, like 1 day, so I
have more numbers for regression?)
Thanks a lot, wish you guys a happy holiday and a great 2007!
MCI ..
To begin with you have to cleanse the 1000 observations of any
anomalies as the standard deviation that you are comouting can be
seriously effected by anonalies. To determine this cleansed set or the
points that need cleansing one needs to have a prediction. If your data
set is daily there may well be day-of-the-week effects ,
week-of-the-year effects , holiday/event effects which must be factored
in to get a prediction ...to detect the anomaly.
Given that you have correctly cleansed the data, one has to concern
oneself with the mechanics of computing the standard deviation. Recall
that the standard deviation is based upon squared residuals around THE
EXPECTED VALUE ....which is equal to the mean under very precise
circumstances. If the data is autocorrelated ( and what daily series
isn't ? ) then it is well known that the standard deviation computed
based upon assuming the mean is the expected value can be seriously
biased. So what you have to do is to identify/estimate/diagnistically
check that you have a set of residuals from a daily predictive model
that has constant mean and whise parameters are invariant over time. If
this be so then one can begin to construct tests of the form you are
considering.
Sorry to be the grinch who stole Christmas ...
Regards
Dave Reilly
Automatic Forecasting Systems
http://www.autobox.com
.
- Prev by Date: Re: Roulette: what to do after 100 'red'-spins
- Next by Date: Re: Comparing fractions (or proportions)
- Previous by thread: Re: A question on time series
- Next by thread: GLM: a bernoulli or a binomial response?
- Index(es):