Learn R Programming

highfrequency (version 0.5.3)

rKernelCov: Realized Covariance: Kernel

Description

Realized covariance calculation using a kernel estimator.

Usage

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

Arguments

rdata

In the multivariate case: a list. Each list-item i contains an xts object with the intraday data of stock i for day t. In the univariate case: an xts object containing the (tick) data for one day.

cor

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

kernel.type

Kernel name (or number)

kernel.param

Kernel parameter (usually lags)

kernel.dofadj

Kernel Degree of freedom adjustment

align.by

Align the tick data to seconds|minutes|hours

align.period

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

cts

Calendar Time Sampling is used

makeReturns

Convert to Returns

type

Deprecated, use kernel.type

adj

Deprecated, use kernel.dofadj

q

Deprecated, use kernel.param

...

...

Value

Kernel estimate of realized covariance.

Details

The different types of kernels can be found using rKernel.available.

References

Ole E. Barndorff-Nielsen, Peter Reinhard Hansen, Asger Lunde, and Neil Shephard. Regular and modified kernel-based estimators of integrated variance: The case with independent noise. Working Paper, 2004.

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.

See Also

rKernel.available

Examples

Run this code
# NOT RUN {
 # Average Realized Kernel Variance/Covariance for CTS aligned at one minute returns at 
 # 5 subgrids (5 minutes).
 data(sample_tdata); 
 data(lltc.xts); 
 data(sbux.xts); 
 
 # Univariate: 
 rvKernel = rKernelCov( rdata = sample_tdata$PRICE, period = 5, align.by ="minutes", 
                   align.period=5, makeReturns=TRUE); 
 rvKernel 
 
 # Multivariate:
 rcKernel = rKernelCov( rdata = list(lltc.xts,sbux.xts), period = 5, align.by ="minutes", 
                   align.period=5, makeReturns=FALSE); 
 rcKernel 
# }

Run the code above in your browser using DataLab