View source: R/realizedMeasures.R
rQuar | R Documentation |
Calculate the realized quarticity (rQuar), defined in Andersen et al. (2012).
Assume there are N
equispaced returns r_{t,i}
in period t
, i=1, \ldots,N
.
Then, the rQuar is given by
\mbox{rQuar}_{t}=\frac{N}{3} \sum_{i=1}^{N} \mbox(r_{t,i}^4)
rQuar(rData, alignBy = NULL, alignPeriod = NULL, makeReturns = FALSE)
rData |
an |
alignBy |
character, indicating the time scale in which |
alignPeriod |
positive numeric, indicating the number of periods to aggregate over. For example, to aggregate
based on a 5-minute frequency, set |
makeReturns |
boolean, should be |
In case the input is an xts
object with data from one day, a numeric of the same length as the number of assets.
If the input data spans multiple days and is in xts
format, an xts
will be returned.
If the input data is a data.table
object, the function returns a data.table
with the same column names as the input data, containing the date and the realized measures.
Giang Nguyen, Jonathan Cornelissen, Kris Boudt, and Emil Sjoerup.
Andersen, T. G., Dobrev, D., and Schaumburg, E. (2012). Jump-robust volatility estimation using nearest neighbor truncation. Journal of Econometrics, 169, 75-93.
rq <- rQuar(rData = sampleTData[, list(DT, PRICE)], alignBy = "minutes",
alignPeriod = 5, makeReturns = TRUE)
rq
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.