ModSharpe: Modified Sharpe Ratio function

Description Usage Arguments Value Examples

View source: R/Modsharpe.R

Description

Function that calculates the modified version of the Sharpe ratio, more coherent when the expected excess portfolio return is negative.

Usage

1
ModSharpe(x, mu, rf, Sigma)

Arguments

x

a vector or matrix - if it is a matrix, the function will return the value of the ModSharpe for each row.

mu

vector of the expected returns of the n risky assets

rf

risk-free rate

Sigma

estimator of the covariance matrix

Value

ModSharpe() returns as object the value of the function modified sharpe ratio calculated in x. If x is a matrix, it returns a column vector and calculates the modified sharpe for each row.

Examples

1
2
3
4
5
6
7
8
r <- matrix( ,nrow =60 ,ncol=25)
for (i in 1:60) {
 r[i,] <- runif(25,-2.5,2.5)
}
mu <- rowMeans(t(r))
Sigma <- cov(r)
xx <- runif(25,0.01,0.30)
ModSharpe(xx,mu,0,Sigma)

FilippoPic/DEoptimPIC documentation built on Feb. 14, 2022, 5:12 a.m.