Learn R Programming

highfrequency (version 0.6.5)

rKernelCov: Realized Covariance: Kernel

Description

Realized covariance calculation using a kernel estimator.

Usage

rKernelCov(
  rdata,
  cor = FALSE,
  align.by = "seconds",
  align.period = 1,
  makeReturns = FALSE,
  kernel.type = "rectangular",
  kernel.param = 1,
  kernel.dofadj = TRUE
)

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

Convert to Returns

kernel.type

Kernel name (or number)

kernel.param

Kernel parameter (usually lags)

kernel.dofadj

Kernel Degree of freedom adjustment

Value

Kernel estimate of realized covariance.

Details

The different types of kernels can be found using listAvailableKernels.

References

Ole E. Barndorff-Nielsen, Peter Reinhard Hansen, Asger Lunde, and Neil Shephard (2008). Designing Realized Kernels to Measure the ex post Variation of Equity Prices in the Presence of Noise. Econometrica, 76, pp. 1481-1536.

B. Zhou. High-frequency data and volatility in foreign-exchange rates. Journal of Buiness & Economic Statistics, 14:45-52, 1996.

P. Hansen and A. Lunde. Realized variance and market microstructure noise. Journal of Business and Economic Statistics, 24:127-218, 2006.

Examples

Run this code
# NOT RUN {
# Univariate:
rvKernel <- rKernelCov(rdata = sample_tdata$PRICE, align.by = "minutes",
                       align.period = 5, makeReturns = TRUE)
rvKernel

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

Run the code above in your browser using DataLab