# MVT

## Description

For investors concerned with both absolute and relative performance, the mean-variance tracking-error (MVT) objective function maximizes a portfolio’s expected return while minimizing both risk and tracking error. This function also allows for the robust specifications of linear and nonlinear constraints.&#x20;

## Syntax

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

```excel-formula
=MVT(mu, sigma, rho, λ1, λ2, wBenchmark, wInitial, tc, lb, ub, constraints, nonlincons)
```

### Input(s)

| Argument        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **mu**          | Required. Vector of expected returns.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| **sigma**       | Required. Vector of expected risk.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| **rho**         | Required. Correlation matrix.                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **λ1**          | Optional. Scalar value for risk aversion. If not specified, it defaults to 1.                                                                                                                                                                                                                                                                                                                                                                                              |
| **λ2**          | Optional. Scalar value for tracking aversion. If not specified, it defaults to 1.                                                                                                                                                                                                                                                                                                                                                                                          |
| **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> |
| **nonlincons**  | <p>Optional. Matrix to specify nonlinear constraint enumeration, operator enumeration, and values: <span class="math">\begin{bmatrix}nonlinType​ & op ​& value\end{bmatrix}</span> <br></p><p>The nonlinType enumeration is <br><span class="math">nonlinType \in \begin{cases} 0: & \text{off}  \1: & \text{same risk} \ 2: & \text{same tracking-error} \end{cases}</span> </p>                                                                                          |

### Output(s)

The function returns a vector of optimal weights $$w$$ across $$N$$assets and appends the corresponding optimization's exit flag.&#x20;

&#x20;  $$\text{output}=\begin{bmatrix}w\_1 & w\_2 & \ldots & w\_N & \text{exitFlag}\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-MLt27r8erls27hgv_6g%2F-MLt3uvSCCrX_JEHQwJA%2Fimage.png?alt=media\&token=c0624002-8b26-4072-97cb-a2c3898a02f2)

{% file src="<https://258561627-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MK66-MGuoULhqCDXLwy%2F-MQVBu1bE5ZOTc1jkwaw%2F-MLt5L-DChWwQ0a3TrWY%2FMVT.xlsx?alt=media&token=354419a6-59e5-458d-9319-3fb936e3b6d4>" %}
Example Workbook: MVT
{% endfile %}

## Further Reading

{% embed url="<https://insights.windhamlabs.com/insights/multi-goal-optimization>" %}
Insights into Windham's Multi-goal Optimization approach
{% endembed %}
