fynance.algorithms.allocation.IVP¶
-
fynance.algorithms.allocation.
IVP
(X, normalize=False, low_bound=0.0, up_bound=1.0)¶ Get weights of the Inverse Variance Portfolio allocation.
Parameters: - X : array_like
Each column is a price or return’s asset series.
- normalize : bool, optional
If True normalize the weights such that \(\sum_{i=1}^{N} w_i = 1\) and \(0 \leq w_i \leq 1\). Default is False.
- low_bound, up_bound : float, optional
Respectively minimum and maximum values of weights, such that low_bound \(\leq w_i \leq\) up_bound \(\forall i\). Default is 0 and 1.
Returns: - np.ndarray
Vector of weights computed by the IVP algorithm.
Notes
w are computed by the inverse of the asset’s variance [3] such that:
\[w_i = \frac{1}{\sigma_k^2} (\sum_{i} \frac{1}{\sigma_i^2})^{-1}\]With \(\sigma_i^2\) is the variance of asset i.
References
[3] https://en.wikipedia.org/wiki/Inverse-variance_weighting