Learn R Programming

highfrequency (version 1.0.1)

rHYCov: Hayashi-Yoshida covariance

Description

Calculates the Hayashi-Yoshida Covariance estimator

Usage

rHYCov(
  rData,
  cor = FALSE,
  period = 1,
  alignBy = "seconds",
  alignPeriod = 1,
  makeReturns = FALSE,
  makePsd = TRUE,
  ...
)

Arguments

rData

an xts or data.table object containing returns or prices, possibly for multiple assets over multiple days.

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.

period

Sampling period

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.

makePsd

boolean, in case it is TRUE, the positive definite version of rHYCov is returned. FALSE by default.

...

used internally. Do not set.

Author

Scott Payseur and Emil Sjoerup.

References

Hayashi, T. and Yoshida, N. (2005). On covariance estimation of non-synchronously observed diffusion processes. Bernoulli, 11, 359-379.

See Also

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

Examples

Run this code
library("xts")
hy <- rHYCov(rData = as.xts(sampleOneMinuteData)["2001-08-05"],
             period = 5, alignBy = "minutes", alignPeriod = 5, makeReturns = TRUE)

Run the code above in your browser using DataLab