rAVGCov {highfrequency} | R Documentation |
Realized covariances via subsample averaging
Description
Calculates realized variances via averaging across partially
overlapping grids, first introduced by Zhang et al. (2005).
This estimator is basically an average across different rCov
estimates that start at
different points in time, see details below.
Usage
rAVGCov(
rData,
cor = FALSE,
alignBy = "minutes",
alignPeriod = 5,
k = 1,
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 |
k |
numeric denoting which horizon to use for the subsambles. This can be a fraction as long as |
makeReturns |
boolean, should be |
... |
used internally, do not change. |
Details
Suppose that in period , there are
equispaced returns
and let
be equal to
alignPeriod
. For ,
we define the subsampled
-period return as
Now define if
and
otherwise.
The
-th component of the
rAVGCov
estimator is given by
Now taking the average across the different defines the
rAVGCov
estimator.
The multivariate version follows analogously.
Note that Liu et al. (2015) show that rAVGCov
is not only theoretically but also empirically a more reliable estimator than rCov.
Value
in case the input is and contains data from one day, an by
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 by
matrices.
Each item in the list has a name which corresponds to the date for the matrix.
Author(s)
Scott Payseur, Onno Kleen, and Emil Sjoerup.
References
Liu, L. Y., Patton, A. J., Sheppard, K. (2015). Does anything beat 5-minute RV? A comparison of realized measures across multiple asset classes. Journal of Econometrics, 187, 293-311.
Zhang, L., Mykland, P. A. , and Ait-Sahalia, Y. (2005). A tale of two time scales: Determining integrated volatility with noisy high-frequency data. Journal of the American Statistical Association, 100, 1394-1411.
See Also
ICov
for a list of implemented estimators of the integrated covariance.
Examples
# Average subsampled realized variance/covariance aligned at one minute returns at
# 5 sub-grids (5 minutes).
# Univariate subsampled realized variance
rvAvgSub <- rAVGCov(rData = sampleTData[, list(DT, PRICE)], alignBy = "minutes",
makeReturns = TRUE)
rvAvgSub
# Multivariate subsampled realized variance
rvAvgCovSub <- rAVGCov(rData = sampleOneMinuteData[1:391], makeReturns = TRUE)
rvAvgCovSub