View source: R/realizedMeasures.R
rBeta | R Documentation |
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
β_{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.
rBeta( rData, rIndex, RCOVestimator = "rCov", RVestimator = "rRVar", makeReturns = FALSE, ... )
rData |
a |
rIndex |
a |
RCOVestimator |
can be chosen among realized covariance estimators: |
RVestimator |
can be chosen among realized variance estimators: |
makeReturns |
boolean, should be |
... |
arguments passed to |
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, …,N).
By default, the RCov is used and the realized beta coefficient is computed as:
\hat{β}_{(jm)t}= \frac{∑_{i=1}^{N} r_{(j)i,t} r_{(m)i,t}}{∑_{i=1}^{N} r_{(m)i,t}^2}.
Note: The function does not support to calculate betas across multiple days.
numeric
Giang Nguyen, Jonathan Cornelissen, Kris Boudt, Onno Kleen, and Emil Sjoerup.
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.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.