Main Content

sharpe

Compute Sharpe ratio for one or more assets

Description

sharpe(Asset) computes Sharpe ratio for each asset.

example

sharpe(Asset,Cash) computes Sharpe ratio for each asset including the optional argument Cash.

example

Ratio = sharpe(Asset,Cash) computes Sharpe ratio for each asset including the optional argument Cash.

example

Examples

collapse all

This example shows how to compute the Sharpe ratio using the mean return of a cash asset as the return for the riskless asset.

Given asset return data and the riskless asset return, the Sharpe ratio is calculated:

load FundMarketCash 
Returns = tick2ret(TestData);
Riskless = mean(Returns(:,3))
Riskless = 
0.0017
Sharpe = sharpe(Returns, Riskless)
Sharpe = 1×3

    0.0886    0.0315         0

The Sharpe ratio of the example fund is significantly higher than the Sharpe ratio of the market. As is demonstrated with portalpha, this translates into a strong risk-adjusted return. Since the Cash asset is the same as Riskless, it makes sense that its Sharpe ratio is 0. The Sharpe ratio is calculated with the mean of cash returns. The Sharpe ratio can also be calculated with the cash return series as input for the riskless asset.

Sharpe = sharpe(Returns, Returns(:,3))
Sharpe = 1×3

    0.0886    0.0315         0

When using the Portfolio object, you can use the estimateMaxSharpeRatio function to estimate an efficient portfolio that maximizes the Sharpe ratio. For more information, see Efficient Portfolio That Maximizes Sharpe Ratio.

Input Arguments

collapse all

Asset returns, specified as a NUMSAMPLES x NUMSERIES matrix with NUMSAMPLES observations of asset returns for NUMSERIES asset return series.

Data Types: double

(Optional) Riskless asset, specified as either a scalar return for a riskless asset or a vector of asset returns to be a proxy for a “riskless” asset. In either case, the periodicity must be the same as the periodicity of Asset. For example, if Asset is monthly data, then Cash must be monthly returns. If no value is supplied, the default value for Cash returns is 0.

Data Types: double

Output Arguments

collapse all

Sharpe ratios, returned as a 1-by-NUMSERIES row vector of Sharpe ratios for each series in Asset. Any series in Asset with standard deviation of returns equal to 0 has a NaN value for its Sharpe ratio.

Note

If Cash is a vector, Asset and Cash need not have the same number of returns but must have the same periodicity of returns. The classic Sharpe ratio assumes that Cash is riskless. In reality, a short-term cash rate is not necessarily riskless. NaN values in the data are ignored.

References

[1] Sharpe, W. F. "Mutual Fund Performance." Journal of Business. Vol. 39, No. 1, Part 2, January 1966, pp. 119–138.

Version History

Introduced in R2006b