Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


highfrequency (version 0.6.5)

rCov: Realized Covariance

Description

Function returns the Realized Covariation (rCov). Let rt,i be an intraday Nx1 return vector and i=1,...,M the number of intraday returns.

Then, the rCov is given by rCovt=i=1Mrt,irt,i.

Usage

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

Arguments

rdata

a (MxN) matrix/zoo/xts object containing the N return series over period t, with M observations during t. In case of a matrix, no multi-day adjustment is possible.

cor

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

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

an NxN matrix

Examples

Run this code
# NOT RUN {
# Realized Variance/Covariance for prices aligned   
# at 5 minutes.
data(sample_tdata)
data(sample_5minprices_jumps)

# Univariate: 
rv = rCov(rdata = sample_tdata$PRICE, align.by = "minutes", 
                   align.period = 5, makeReturns = TRUE)
rv 

# Multivariate: 
rc = rCov(rdata = sample_5minprices_jumps['2010-01-04'], makeReturns=TRUE)
rc
# }

Run the code above in your browser using DataLab