MVP¶
Defined in fynance.algorithms.allocation
- MVP(X, normalize=False)[source]
Get weights of the Minimum Variance Portfolio allocation.
Closed-form Markowitz allocation that minimizes the portfolio variance subject only to a sum-to-one constraint. Weights are not constrained to be positive — short positions are allowed and the weights returned by the analytical formula can be negative or larger than one. Use
MVP_ucfor a constrained variant.The covariance matrix must be invertible; pseudo-inverse is used as a fallback when
Xhas linearly dependent columns.- Parameters:
- Xarray_like
Each column is a time-series of price or return’s asset.
- normalizeboolean, optional
If True normalize the weigths such that \(0 \leq w_i \leq 1\) and \(\sum_{i=1}^{N} w_i = 1\), \(\forall i\). Default is False.
- Returns:
- array_like
Vector of weights to apply to the assets.
See also
HRP
Notes
The vector of weights noted \(w\) that minimize the portfolio variance [4] is define as below:
\[\begin{split}w = \frac{\Omega^{-1} e}{e' \Omega^{-1} e} \\\end{split}\]\[\text{With } \sum_{i=1}^{N} w_i = 1\]Where \(\Omega\) is the asset’s variance-covariance matrix and \(e\) is a vector of ones.
References