Learn R Programming

highfrequency (version 0.6.5)

rAVGCov: Realized Covariance: Average Subsample

Description

Realized Covariance using average subsample.

Usage

rAVGCov(
  rdata,
  cor = FALSE,
  align.by = "minutes",
  align.period = 5,
  makeReturns = FALSE
)

Arguments

rdata

a \((M x N)\) matrix/zoo/xts object containing the \(N\) return series over period \(t\), with \(M\) observations during \(t\).

cor

boolean, in case it is TRUE, the correlation is returned. FALSE by default.

align.by

Align the tick data to seconds|minutes|hours

align.period

Align the tick data to this many [seconds|minutes|hours]

makeReturns

Prices are passed make them into log returns

Value

Realized covariance using average subsample.

References

L. Zhang, P.A Mykland, and Y. Ait-Sahalia. A tale of two time scales: Determining integrated volatility with noisy high-frequency data. Journal of the American Statistical Association, 2005.

Michiel de Pooter, Martin Martens, and Dick van Dijk. Predicting the daily covariance matrix for S\&P100 stocks using intraday data - but which frequency to use? Econometric Reviews, 2008.

Examples

Run this code
# NOT RUN {
# Average subsampled realized variance/covariance aligned at one minute returns at 
# 5 subgrids (5 minutes).

# Univariate
rvSub <- rAVGCov(rdata = sample_tdata$PRICE, align.by = "minutes",
                 align.period = 5, makeReturns = TRUE) 
rvSub

# Multivariate:
rcovSub <- rAVGCov(rdata = cbind(lltc, sbux, fill = 0), align.by = "minutes", 
                   align.period = 5, makeReturns = FALSE)
rcovSub

# }

Run the code above in your browser using DataLab