rBeta: Realized beta

View source: R/realizedMeasures.R

rBetaR Documentation

Realized beta

Description

Depending on users' choices of estimator (realized covariance (RCOVestimator) and realized variance (RVestimator)), the function returns the realized beta, defined as the ratio between both.

The realized beta is given by

\beta_{jm} = \frac {RCOVestimator_{jm}}{RVestimator_{m}}

in which

RCOVestimator: Realized covariance of asset j and market index m.

RVestimator: Realized variance of market index m.

Usage

rBeta(
  rData,
  rIndex,
  RCOVestimator = "rCov",
  RVestimator = "rRVar",
  makeReturns = FALSE,
  ...
)

Arguments

rData

a xts object containing all returns in period t for one asset.

rIndex

a xts object containing return in period t for an index.

RCOVestimator

can be chosen among realized covariance estimators: "rCov", "rAVGCov", "rBPCov", "rHYCov", "rKernelCov", "rOWCov", "rRTSCov", "rThresholdCov" and "rTSCov" "rCov" by default.

RVestimator

can be chosen among realized variance estimators: "rRVar", "rMinRVar" and "rMedRVar". "rRVar" by default. In case of missing RVestimator, RCOVestimator function applying for rIndex will be used.

makeReturns

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

...

arguments passed to RCOVestimator and RVestimator

Details

Suppose there are N equispaced returns on day t for the asset j and the index m. Denote r_{(j)i,t}, r_{(m)i,t} as the ith return on day t for asset j and index m (with i=1, \ldots,N).

By default, the RCov is used and the realized beta coefficient is computed as:

\hat{\beta}_{(jm)t}= \frac{\sum_{i=1}^{N} r_{(j)i,t} r_{(m)i,t}}{\sum_{i=1}^{N} r_{(m)i,t}^2}.

Note: The function does not support to calculate betas across multiple days.

Value

numeric

Author(s)

Giang Nguyen, Jonathan Cornelissen, Kris Boudt, Onno Kleen, and Emil Sjoerup.

References

Barndorff-Nielsen, O. E. and Shephard, N. (2004). Econometric analysis of realized covariation: high frequency based covariance, regression, and correlation in financial economics. Econometrica, 72, 885-925.

Examples

## Not run: 
library("xts")
a <- as.xts(sampleOneMinuteData[as.Date(DT) == "2001-08-04", list(DT, MARKET)])
b <-  as.xts(sampleOneMinuteData[as.Date(DT) == "2001-08-04", list(DT, STOCK)])
rBeta(a, b, RCOVestimator = "rBPCov", RVestimator = "rMinRVar", makeReturns = TRUE)

## End(Not run)


highfrequency documentation built on Oct. 4, 2023, 5:08 p.m.