Skip to content
Prev 7967 / 15274 Next

Excessive data needed for volatility{TTR} calculation?

Hi James,
On Fri, May 27, 2011 at 9:33 PM, J Toll <jctoll at gmail.com> wrote:
Thanks for digging into this.  I've recently received one or two
emails about this off-list, but have not had time to look into the
issue.

I think your solution will work, but using 'n' instead of 'n-1'.  The
code below shows the same results using your solution and a formula
similar to the one found here (which I mis-interpreted when I
originally wrote the function):
http://web.archive.org/web/20081224134043/http://www.sitmo.com/eq/172

set.seed(21)
N <- 260
n <- 100
r <- rnorm(n)/100
last(sqrt(N) * runSD(r, n))
sqrt(N/(n-1)*sum((r-mean(r))^2))

Thanks!
--
Joshua Ulrich  |  FOSS Trading: www.fosstrading.com