Learn R Programming

SharpeR (version 1.0.0)

sr_vcov: Compute variance covariance of Sharpe Ratios.

Description

Computes the variance covariance matrix of sample Sharpe ratios.

Usage

sr_vcov(X,vcov.func=vcov,ope=1)

Arguments

X
an $n \times p$ matrix of observed returns.
vcov.func
a function which takes an object of class lm, and computes a variance-covariance matrix.
ope
the number of observations per 'epoch'. For convenience of interpretation, The Sharpe ratio is typically quoted in 'annualized' units for some epoch, that is, 'per square root epoch', though returns are observed at a frequency of ope per epoc

Value

  • a list containing the following components:
  • SRa vector of (annualized) Sharpe ratios.
  • Ohata $p \times p$ variance covariance matrix.
  • pthe number of assets.

Details

Given $n$ contemporaneous observations of $p$ returns streams, this function estimates the asymptotic variance covariance matrix of the vector of sample Sharpes, $\left[\zeta_1,\zeta_2,\ldots,\zeta_p\right]$

One may use the default method for computing covariance, via the vcov function, or via a 'fancy' estimator, like sandwich:vcovHAC, sandwich:vcovHC, etc.

This code first estimates the covariance of the $2p$ vector of the vector $x$ stacked on its Hadamard square, $x^2$. This is then translated back to a variance covariance on the vector of sample Sharpe ratios via the Delta method.

References

Sharpe, William F. "Mutual fund performance." Journal of business (1966): 119-138. http://ideas.repec.org/a/ucp/jnlbus/v39y1965p119.html

Lo, Andrew W. "The statistics of Sharpe ratios." Financial Analysts Journal 58, no. 4 (2002): 36-52. http://ssrn.com/paper=377260

See Also

reannualize

sr-distribution functions, dsr

Other sr: as.sr, as.sr.data.frame, as.sr.default, as.sr.lm, as.sr.matrix, as.sr.timeSeries, as.sr.xts; confint.del_sropt, confint.sr, confint.sropt; dsr, psr, qsr, rsr; is.sr; plambdap, qlambdap, rlambdap; power.sr_test; predint; print.del_sropt, print.sr, print.sropt; reannualize, reannualize.sr, reannualize.sropt; se, se.sr; sr_equality_test; sr_test; sr_unpaired_test; sr

Examples

Run this code
X <- matrix(rnorm(1000*3),ncol=3)
colnames(X) <- c("ABC","XYZ","WORM")
Sigmas <- sr_vcov(X)
# make it fat tailed:
X <- matrix(rt(1000*3,df=5),ncol=3)
Sigmas <- sr_vcov(X)
if (require(sandwich)) {
	Sigmas <- sr_vcov(X,vcov.func=vcovHC)
}
# add some autocorrelation to X
Xf <- filter(X,c(0.2),"recursive")
colnames(Xf) <- colnames(X)
Sigmas <- sr_vcov(Xf)
if (require(sandwich)) {
	Sigmas <- sr_vcov(Xf,vcov.func=vcovHAC)
}

Run the code above in your browser using DataLab