Date: Wed, 5 Mar 2008 19:39:26 -0500
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>"
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>"
Subject: Re: How to continuously calculate volitility using data in the
previous t days
On Wed, 5 Mar 2008 11:19:56 -0500, Hei Hei <towangyi@YAHOO.COM> wrote:
>1. data file- daily equity return from 1971 to 2007;
>2. Assuming the volatility at time t is estimated by the daily return data
>of the previous 252 days (trading days in a year);
>3. Q: How to write the program to continuously estimate the daily volatility
>from 1971 to 2007 and write these volatility estimates into a separate file?
I suspect it can be done, quite efficiently, by loading the time series into
an array (either the old-timey kind or a hash) and looping over the
look-back period for each day.
1. What is the formula for deriving a daily volatility figure from the past
2. 252 trading days per year is a bit of an approximation. Which is
preferred: looking back exactly 252 trading days, or looking back exactly
one calendar year?