rMedRQuar {highfrequency}R Documentation

An estimator of integrated quarticity from applying the median operator on blocks of three returns

Description

Calculate the rMedRQ, defined in Andersen et al. (2012). Assume there are N equispaced returns r_{t,i} in period t, i=1, \ldots,N. Then, the rMedRQ is given by

\mbox{rMedRQ}_{t}=\frac{3\pi N}{9\pi +72 - 52\sqrt{3}} \left(\frac{N}{N-2}\right) \sum_{i=2}^{N-1} \mbox{med}(|r_{t,i-1}|, |r_{t,i}|, |r_{t,i+1}|)^4.

Usage

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

Arguments

rData

an xts or data.table object containing returns or prices, possibly for multiple assets over multiple days.

alignBy

character, indicating the time scale in which alignPeriod is expressed. Possible values are: "ticks", "secs", "seconds", "mins", "minutes", "hours"

alignPeriod

positive numeric, indicating the number of periods to aggregate over. For example, to aggregate based on a 5-minute frequency, set alignPeriod to 5 and alignBy to "minutes".

makeReturns

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

Value

Author(s)

Giang Nguyen, Jonathan Cornelissen, Kris Boudt, and Emil Sjoerup.

References

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

Examples

rq <- rMedRQuar(rData = sampleTData[, list(DT, PRICE)], alignBy = "minutes",
            alignPeriod = 5, makeReturns = TRUE)
rq

[Package highfrequency version 1.0.1 Index]