| rQPVar {highfrequency} | R Documentation |
Realized quad-power variation of intraday returns
Description
Calculate the realized quad-power variation, defined in Andersen et al. (2012).
Assume there are N equispaced returns r_{t,i} in period t, i=1, \ldots,N. Then, the rQPVar is given by
\mbox{rQPVar}_{t}=N*\frac{N}{N-3} \left(\frac{\pi^2}{4} \right)^{-4} \mbox({|r_{t,i}|} {|r_{t,i-1}|} {|r_{t,i-2}|} {|r_{t,i-3}|})
Usage
rQPVar(rData, alignBy = NULL, alignPeriod = NULL, makeReturns = FALSE, ...)
Arguments
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 |
... |
used internally, do not change. |
Value
In case the input is an
xtsobject 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
xtsformat, anxtswill be returned.If the input data is a
data.tableobject, the function returns adata.tablewith the same column names as the input data, containing the date and the realized measures.
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.
See Also
IVar for a list of implemented estimators of the integrated variance.
Examples
qpv <- rQPVar(rData= sampleTData[, list(DT, PRICE)], alignBy= "minutes",
alignPeriod =5, makeReturns= TRUE)
qpv