Learn R Programming

highfrequency (version 0.7.0.1)

rKernelCov: Realized Covariance: Kernel

Description

Realized covariance calculation using a kernel estimator.

Usage

rKernelCov(
  rData,
  cor = FALSE,
  alignBy = "seconds",
  alignPeriod = 1,
  makeReturns = FALSE,
  kernelType = "rectangular",
  kernelParam = 1,
  kernelDOFadj = 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.

alignBy

Align the tick data to seconds|minutes|hours

alignPeriod

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

makeReturns

Convert to Returns

kernelType

Kernel name (or number)

kernelParam

Kernel parameter (usually lags)

kernelDOFadj

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 Business & 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 = sampleTData$PRICE, alignBy = "minutes",
                       alignPeriod = 5, makeReturns = TRUE)
rvKernel

# Multivariate:
rcKernel <- rKernelCov(rData = cbind(lltc, sbux, fill = 0), alignBy = "minutes",
                       alignPeriod = 5, makeReturns = FALSE)
rcKernel
# }

Run the code above in your browser using DataLab