Accelerating the pace of engineering and science

# estimateMaxSharpeRatio

Class: Portfolio

Estimate efficient portfolio to maximize Sharpe ratio

## Description

[pwgt,pbuy,psell] = estimateMaxSharpeRatio(obj) estimates an efficient portfolio that maximizes the Sharpe ratio.

## Tips

You can also use dot notation to estimate an efficient portfolio that maximizes the Sharpe ratio.

`[pwgt,pbuy,psell] = obj.estimateMaxSharpeRatio;`

## Input Arguments

obj

Portfolio object [Portfolio].

 Note:   The risk-free rate is obtained from the property RiskFreeRate in the Portfolio object. If you leave the RiskFreeRate unset, it is assumed to be 0.

## Output Arguments

 pwgt A portfolio on the efficient frontier with a maximum Sharpe ratio [NumAssets vector]. pbuy Purchases relative to an initial portfolio for a portfolio on the efficient frontier with a maximum Sharpe ratio [NumAssets vector]. psell Sales relative to an initial portfolio for a portfolio on the efficient frontier with maximum Sharpe ratio [NumAssets vector].

## Definitions

### Sharpe Ratio

The Sharpe ratio is the ratio of the difference between the mean of portfolio returns and the risk-free rate divided by the standard deviation of portfolio returns. This method maximizes the Sharpe ratio among portfolios on the efficient frontier.

## Attributes

 Access public Static false Hidden false

To learn about attributes of methods, see Method Attributes in the MATLAB® Object-Oriented Programming documentation.

## Examples

expand all

### Estimate Efficient Portfolio that Maximizes the Sharpe Ratio

Estimate the efficient portfolio that maximizes the Sharpe ratio.

```p = Portfolio('AssetMean',[0.3, 0.1, 0.5], 'AssetCovar',...
[0.01, -0.010,  0.004; -0.010,  0.040, -0.002;  0.004, -0.002,  0.023]);
p = setDefaultConstraints(p);
plotFrontier(p, 20);
weights = estimateMaxSharpeRatio(p);
[risk, ret] = estimatePortMoments(p, weights);
hold on
plot(risk,ret,'*r');
```

## Algorithms

The maximization of the Sharpe ratio is accomplished by a one-dimensional optimization using fminbnd to find the portfolio that minimizes the negative of the Sharpe ratio. The method takes only a fully qualified Portfolio object as its input and uses all information in the object to solve the problem.