Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Estimate efficient portfolio to maximize Sharpe ratio for Portfolio object

```
[pwgt,pbuy,psell]
= estimateMaxSharpeRatio(obj)
```

```
[pwgt,pbuy,psell]
= estimateMaxSharpeRatio(___,Name,Value)
```

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

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

The maximization of the Sharpe ratio is accomplished by either using the
`'direct'`

or `'iterative'`

method. For the `'direct'`

method, consider the following
scenario. To maximize the Sharpe ratio is to:

$$Maximize\frac{{\mu}^{T}x-{r}_{f}}{\sqrt{{x}^{T}Cx}},s.t.{\displaystyle \sum {x}_{i}=1,\text{}0\le {x}_{i}\le 1,}$$

where *μ* and *C* are the mean and
covariance matrix, and
*r*_{f} is
the risk-free rate.

If *μ*^{T}
*x* -
*r*_{f} ≤ 0
for all *x* the portfolio that maximizes the Sharpe ratio
is the one with maximum return.

If *μ*^{T}
*x* -
*r*_{f} > 0,
let $$t=\frac{1}{{\mu}^{T}x-{r}_{f}}$$

and *y* = *t**x*
(Cornuejols [1] section 8.2). Then after some substitutions, we can
transform the original problem into the following form,

$$Minimize\text{}{y}^{T}Cy,\text{}s.t.\text{}{\displaystyle \sum {y}_{i}=t,\text{}t0,\text{0}\le {y}_{i}\le \text{t,}{\mu}^{T}y-{r}_{f}\text{t}=1.\text{}}$$

Only one optimization needs to be solved, hence the name “direct”. The
portfolio weights can be recovered by
*x*^{*}
= *y*^{*} /
*t*^{*}.

For the `'iterative'`

method, the idea is to iteratively
explore the portfolios at different return levels on the efficient frontier
and locate the one with maximum Sharpe ratio. Therefore, multiple
optimization problems are solved during the process, instead of only one in
the `'direct'`

method. Consequently, the
`'iterative'`

method is slow compared to
`'direct'`

method.

[1] Cornuejols, G. and Reha Tütüncü. *Optimization Methods in
Finance.* Cambridge University Press, 2007.

`estimateFrontier`

| `estimateFrontierByReturn`

| `estimateFrontierByRisk`

| `estimatePortSharpeRatio`

| `setBounds`

| `setMinMaxNumAssets`