# ISORETURN

## Description

Solve for multiple optimal portfolios on the efficient surface for a specified target return. Evaluate the tradeoff between absolute risk and relative risk (tracking-error).

{% hint style="warning" %}
The convexity of the efficient frontier may not necessarily hold when transaction costs are present.
{% endhint %}

## Syntax

The following describes the function signature for use in Microsoft Excel's formula bar.

```excel-formula
=ISORETURN(P, target, mu, sigma, rho, wBenchmark, wInitial, tc, lb, ub, constraints)
```

### Input(s)

| Argument        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **P**           | Required. Number of portfolios to solve for, $$P \geq 5$$.                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **target**      | Required. Target expected returns, the target level must be between the return of minimum risk portfolio and the maximum return portfolio.                                                                                                                                                                                                                                                                                                                                 |
| **mu**          | Required. Vector of expected returns.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **sigma**       | Required. Vector of expected risk.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **rho**         | Required. Correlation matrix.                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **wBenchmark**  | Optional. Vector of benchmark weights. If not specified, the function assumes a vector of zeros.                                                                                                                                                                                                                                                                                                                                                                           |
| **wInitial**    | Optional. Vector of initial weights (or your current weights). If not specified, the function assumes a vector of zeros.                                                                                                                                                                                                                                                                                                                                                   |
| **tc**          | Optional. Vector of transaction costs. If not specified, the function assumes a vector of zeros.                                                                                                                                                                                                                                                                                                                                                                           |
| **lb**          | Optional. Vector of lower bound limits. If not specified, it defaults to a vector of zeros.                                                                                                                                                                                                                                                                                                                                                                                |
| **ub**          | Optional. Vector of upper bound limits. If the argument is not specified, it defaults to a vector of ones.                                                                                                                                                                                                                                                                                                                                                                 |
| **constraints** | <p>Optional. Matrix of constraints, operator enumeration, and values: <span class="math">\begin{bmatrix}A & op \&b\end{bmatrix}</span> </p><p></p><p>The operator enumeration is represented by <span class="math">op \in \begin{cases} 0: & \leq  \1: & = \ 2: & \geq \end{cases}</span> </p><p></p><p>If the argument is not specified, it will default to a fully-funded constraint.<br>i.e. <span class="math">\begin{bmatrix}1,1,…,1\_N​,1,1\end{bmatrix}</span> </p> |

### Output(s)

The function returns optimal weights $$w$$ across $$N$$assets for $$P$$portfolios. The portfolios' expected risk, tracking-error, and corresponding optimization's exit flag is appended at the end of the matrix.

$$\text{output} = \begin{bmatrix}   w\_{1,1} & w\_{1,2} & \ldots & w\_{1,K}  & \sigma\_1 & \sigma\_{te\_1} &  \text{exitFlag}*1 \   w*{2,1} & w\_{2,2} & \ldots & w\_{2,K}  & \sigma\_2 & \sigma\_{te\_2} &  \text{exitFlag}*2 \ \   \vdots & \vdots & \ddots & \vdots  & \vdots & \vdots &  \vdots \ \ w*{N,1} & w\_{N,2} & \ldots & w\_{N,K}  & \sigma\_N & \sigma\_{te\_N} &  \text{exitFlag}\_N  \end{bmatrix}$$&#x20;

The output matrix follows the vector orientation of mu (column / row). If you have specified your inputs as column-vectors, the corresponding output matrix will be transpose of the above.

| exitFlag | Description                                                                                         |
| :------: | --------------------------------------------------------------------------------------------------- |
|  **-2**  | No feasible solution found. Check your constraints and problem definition.                          |
|  **-1**  | Unexpected interruption.                                                                            |
|   **0**  | Number of iterations exceeded.                                                                      |
|   **1**  | First-order optimality measure is less than tolerance threshold and the constraints were satisfied. |
|   **2**  | Delta in optimal weights is less than the configured numerical step size.                           |
|   **3**  | Change in the expected utility value is less than the tolerance threshold.                          |
|   **4**  | Magnitude of search direction was less than the configured threshold.                               |
|   **5**  | Magnitude of directional derivative in the search direction was less than the configured threshold. |

## Example

![](https://258561627-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MK66-MGuoULhqCDXLwy%2F-MM2alUWNI_bv6nYM6y3%2F-MM2frO21cqGqwd5k2k1%2Fimage.png?alt=media\&token=d88b901b-9359-4662-b12a-368f240a7db3)

{% file src="<https://258561627-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MK66-MGuoULhqCDXLwy%2F-MQVB0PqO2NLdKWDSNEn%2F-MM2fxW1xZ-EIJ_6WAEJ%2FISORETURN.xlsx?alt=media&token=3f318041-2ca2-4573-b20e-d49754496e24>" %}
Example Workbook: ISORETURN
{% endfile %}
