Learn R Programming

highfrequency (version 0.7.0.1)

minRV: minRV

Description

Function returns the minRV, defined in Andersen et al. (2009).

Let \(r_{t,i}\) be a return (with \(i=1,\ldots,M\)) in period \(t\).

Then, the minRV is given by $$ \mbox{minRV}_{t}=\frac{\pi}{\pi - 2}\left(\frac{M}{M-1}\right) \sum_{i=1}^{M-1} \mbox{min}(|r_{t,i}| ,|r_{t,i+1}|)^2 $$

Usage

minRV(rData, alignBy = NULL, alignPeriod = NULL, makeReturns = FALSE)

Arguments

rData

a zoo/xts object containing all returns in period t for one asset.

alignBy

a string, align the tick data to "seconds"|"minutes"|"hours".

alignPeriod

an integer, align the tick data to this many [seconds|minutes|hours].

makeReturns

boolean, should be TRUE when rData contains prices instead of returns. FALSE by default.

Value

numeric

References

Andersen, T. G., D. Dobrev, and E. Schaumburg (2012). Jump-robust volatility estimation using nearest neighbor truncation. Journal of Econometrics, 169 (1), 75-93.

Examples

Run this code
# NOT RUN {
data(sampleTData)
minrv <- minRV(rData = sampleTData$PRICE, alignBy = "minutes",
               alignPeriod = 5, makeReturns = TRUE)
minrv 

# }

Run the code above in your browser using DataLab