# Mean Variance Optimization
The best entry point into understanding **Mean Variance Optimization (MVO)** is through it's core mathematical objects.
There are two main spaces we are interested in: **return space** and **weight space**. They are *not* the same space, even they are both $\mathbb{R}^n$. There are four main objects of interest that live in these spaces:
| | **<span style="color:rgb(192, 0, 0)">Returns vector</span>** | **<span style="color:rgb(192, 0, 0)">Mu Vector</span>** | **<span style="color:rgb(192, 0, 0)">Covariance of returns</span>** | **<span style="color:rgb(192, 0, 0)">Portfolio weights vector</span>** |
| ------------------------------- | -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Symbol** | $R = [R_1, \dots, R_n]$ | $\mu = \mathbb{E}[R]$ | $\Sigma = \text{Cov}(R)$ | $w = [w_1, \dots, w_n]$ |
| **Definition** | Returns of each asset at a specific point in time | Mean return of assets | Covariance matrix computed from historical return data | Proportion of capital allocated to each asset |
| **Space** | Return | Return | Return | Weight |
| **Notes** | [Random Variable](Random%20Variable.md) | Center of the $\Sigma$ ellipse in return space | Encodes variance and correlations of asset returns | Typically treated as fixed in analysis |
| **Geometry / Role in MD & MVO** | A _point_ in return space; distribution of $R$ has shape given by $\Sigma$ | Origin point for Mahalanobis distance contours; in MVO, $\Sigma^{-1}\mu$ is the risk-adjusted optimal direction | Defines the _Mahalanobis geometry_ in return space: ellipses of equal risk; whitening by $\Sigma^{-1/2}$ makes them spheres | In weight space, $\Sigma$ defines the _variance ellipse_ $w^T \Sigma w = \text{const}$; $\Sigma^{-1}\mu$ gives optimal direction in unconstrained MVO |
| | | | | |
We can visualize these space and their objects. Until other wise stated, we'll set $n=2$ and thus return and weight space are $\mathbb{R}^2$. Lets start simple and just look at a single, fixed $r \sim R$ and $w$. We can compute the portfolio return, $r_p$, via their dot product: $r_p = w^T r$.

But we aren't interested in a specific $r_p$ based on a specific $r$. We want to see the distribution of $R_p