highfrequency – R package
highfrequency is an R package that can be used to 1) clean and aggregate high frequency data, 2) compute realized volatility measures 3) compute liquidity measures. The package is an improved version of two other R packages, RTAQ and realized. The vignette for thepackage explains two models, HAR and HEAVY models. HAR models rely on jump modeling and one needs to have a decent idea of Levy processes to appreciate the HAR variants. There are also a ton of realized volatility measures that can be obtained from the package functions. The following is the list :
The timeseries object used in the implementation is xts. Packages like these are good starting points to understand various realized volatility measures. Each of the 11 volatility measures are mostly likely associated with about dozen or more academic papers. Plodding through them is time consuming and at times mentally exhausting. But the fact that there is a open source package that has already implemented the algos is a great motivating factor for someone looking to understand the actual code. There are also good reference papers mentioned in the vignette.