Learn R Programming

highfrequency (version 0.5.3)

rCov: Realized Covariance

Description

Function returns the Realized Covariation (rCov).

Let \(r_{t,i}\) be an intraday \(N x 1\) return vector and \(i=1,...,M\) the number of intraday returns.

Then, the rCov is given by $$ \mbox{rCov}_{t}=\sum_{i=1}^{M}r_{t,i}r'_{t,i}. $$

Usage

rCov(rdata,cor = FALSE, align.by = NULL, align.period = NULL, 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

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.

...

additional arguments.

Value

an \(N x N\) matrix

Examples

Run this code
# NOT RUN {
 # Realized Variance/Covariance for CTS 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