View source: R/realizedMeasures.R
rCov | R Documentation |
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}.
rCov(
rData,
cor = FALSE,
alignBy = NULL,
alignPeriod = NULL,
makeReturns = FALSE,
...
)
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. |
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.
Jonathan Cornelissen, Kris Boudt, and Emil Sjoerup.
ICov
for a list of implemented estimators of the integrated covariance.
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.