Learn R Programming

highfrequency (version 0.6.5)

rTPVar: Realized tri-power variation estimator of quarticity for a highfrequency return series.

Description

Function returns the rTPVar, defined in Andersen et al. (2012).

Assume there is \(N\) equispaced returns in period \(t\). Let \(r_{t,i}\) be a return (with \(i=1, \ldots,N\)) in period \(t\).

Then, the rTPVar is given by $$ \mbox{rTPVar}_{t}=N\frac{N}{N-2} \left(\frac{\Gamma \left(0.5\right)}{ 2^{2/3}\Gamma \left(7/6\right)} \right)^{3} \sum_{i=3}^{N} \mbox({|r_{t,i}|}^{4/3} {|r_{t,i-1}|}^{4/3} {|r_{t,i-2}|}^{4/3}) $$

Usage

rTPVar(rdata, align.by = NULL, align.period = NULL, makeReturns = FALSE)

Arguments

rdata

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

align.by

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

align.period

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(sample_tdata)
rTPVar(rdata = sample_tdata$PRICE, align.by = "minutes", align.period = 5, makeReturns = TRUE)
rTPVar

# }

Run the code above in your browser using DataLab