Learn R Programming

highfrequency (version 1.0.1)

rOWCov: Realized outlyingness weighted covariance

Description

Calculate the Realized Outlyingness Weighted Covariance (rOWCov), defined in Boudt et al. (2008).

Let \(r_{t,i}\), for \(i = 1,..., M\) be a sample of \(M\) high-frequency \((N \times 1)\) return vectors and \(d_{t,i}\) their outlyingness given by the squared Mahalanobis distance between the return vector and zero in terms of the reweighted MCD covariance estimate based on these returns.

Then, the rOWCov is given by $$ \mbox{rOWCov}_{t}=c_{w}\frac{\sum_{i=1}^{M}w(d_{t,i})r_{t,i}r'_{t,i}}{\frac{1}{M}\sum_{i=1}^{M}w(d_{t,i})}, $$ The weight \(w_{i,\Delta}\) is one if the multivariate jump test statistic for \(r_{i,\Delta}\) in Boudt et al. (2008) is less than the 99.9% percentile of the chi-square distribution with \(N\) degrees of freedom and zero otherwise. The scalar \(c_{w}\) is a correction factor ensuring consistency of the rOWCov for the Integrated Covariance, under the Brownian Semimartingale with Finite Activity Jumps model.

Usage

rOWCov(
  rData,
  cor = FALSE,
  alignBy = NULL,
  alignPeriod = NULL,
  makeReturns = FALSE,
  seasadjR = NULL,
  wFunction = "HR",
  alphaMCD = 0.75,
  alpha = 0.001,
  ...
)

Value

an \(N \times N\) matrix

Arguments

rData

a \((M x N)\) xts object containing the \(N\) return series over period \(t\), with \(M\) observations during \(t\).

cor

boolean, in case it is TRUE, and the input data is multivariate, the correlation is returned instead of the covariance matrix. FALSE by default.

alignBy

character, indicating the time scale in which alignPeriod is expressed. Possible values are: "ticks", "secs", "seconds", "mins", "minutes", "hours"

alignPeriod

positive numeric, indicating the number of periods to aggregate over. For example, to aggregate based on a 5-minute frequency, set alignPeriod = 5 and alignBy = "minutes".

makeReturns

boolean, should be TRUE when rData contains prices instead of returns. FALSE by default.

seasadjR

a \((M x N)\) xts object containing the seasonally adjusted returns. This is an optional argument.

wFunction

determines whether a zero-one weight function (one if no jump is detected based on \(d_{t,i}\) and 0 otherwise) or Soft Rejection ("SR") weight function is to be used. By default a zero-one weight function (wFunction = "HR") is used.

alphaMCD

a numeric parameter, controlling the size of the subsets over which the determinant is minimized. Allowed values are between 0.5 and 1 and the default is 0.75. See Boudt et al. (2008) or the covMcd function in the robustbase package.

alpha

is a parameter between 0 and 0.5, that determines the rejection threshold value (see Boudt et al. (2008) for details).

...

used internally, do not change.

Author

Jonathan Cornelissen, Kris Boudt, and Emil Sjoerup.

Details

Advantages of the rOWCov compared to the rBPCov include a higher statistical efficiency, positive semi-definiteness and affine equi-variance. However, the rOWCov suffers from a curse of dimensionality. The rOWCov gives a zero weight to a return vector if at least one of the components is affected by a jump. In the case of independent jump occurrences, the average proportion of observations with at least one component being affected by jumps increases fast with the dimension of the series. This means that a potentially large proportion of the returns receives a zero weight, due to which the rOWCov can have a low finite sample efficiency in higher dimensions.

References

Boudt, K., Croux, C., and Laurent, S. (2008). Outlyingness weighted covariation. Journal of Financial Econometrics, 9, 657–684.

See Also

ICov for a list of implemented estimators of the integrated covariance.

Examples

Run this code
if (FALSE) {
library("xts")
# Realized Outlyingness Weighted Variance/Covariance for prices aligned
# at 1 minutes.

# Univariate:
row <- rOWCov(rData = as.xts(sampleOneMinuteData[as.Date(DT) == "2001-08-04",
                                                 list(DT, MARKET)]), makeReturns = TRUE)
row

# Multivariate:
rowc <- rOWCov(rData = as.xts(sampleOneMinuteData[as.Date(DT) == "2001-08-04",]),
               makeReturns = TRUE)
rowc
}

Run the code above in your browser using DataLab