rCov {highfrequency} | R Documentation |
Realized covariance
Description
Function returns the Realized Covariation (rCov).
Let r_{t,i}
be an intraday N \times M
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,
alignBy = NULL,
alignPeriod = NULL,
makeReturns = FALSE,
...
)
Arguments
rData |
an |
cor |
boolean, in case it is |
alignBy |
character, indicating the time scale in which |
alignPeriod |
positive numeric, indicating the number of periods to aggregate over. For example, to aggregate
based on a 5-minute frequency, set |
makeReturns |
boolean, should be |
... |
used internally, do not change. |
Value
in case the input is and contains data from one day, an N \times N
matrix is returned. If the data is a univariate xts
object with multiple days, an xts
is returned.
If the data is multivariate and contains multiple days (xts
or data.table
), the function returns a list containing N by N matrices. Each item in the list has a name which corresponds to the date for the matrix.
Author(s)
Jonathan Cornelissen, Kris Boudt, and Emil Sjoerup.
See Also
ICov
for a list of implemented estimators of the integrated covariance.
Examples
# Realized Variance/Covariance for prices aligned at 5 minutes.
# Univariate:
rv = rCov(rData = sampleTData[, list(DT, PRICE)], alignBy = "minutes",
alignPeriod = 5, makeReturns = TRUE)
rv
# Multivariate:
rc = rCov(rData = sampleOneMinuteData, makeReturns = TRUE)
rc