Learn R Programming

highfrequency (version 0.5.3)

rBeta: Realized beta: a tool in measuring risk with respect to the market.

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= "RV", 
                makeReturns= FALSE,...)

Arguments

rdata

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

rindex

a zoo/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: RV, minRV and medRV. RV 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.

...

additional arguments.

Value

numeric

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 \(i\)th 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} $$

(Barndorff & Shephard (2004)).

Note: It is worth to note that the function does not support to calculate for data of multiple days.

References

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

Examples

Run this code
# NOT RUN {
data(sample_5minprices_jumps)
a=sample_5minprices_jumps['2010-01-04',1]
b=sample_5minprices_jumps['2010-01-04',2]

rBeta(a,b,RCOVestimator="rBPCov",RVestimator="minRV",makeReturns=TRUE)
# }

Run the code above in your browser using DataLab