fynance.algorithms.allocation.HRP¶
-
fynance.algorithms.allocation.
HRP
(X, method='single', metric='euclidean', low_bound=0.0, up_bound=1.0)¶ Get weights of the Hierarchical Risk Parity allocation.
Parameters: - X : array_like
Each column is a price or return’s asset series. Some errors will happen if one or more series are constant.
- method, metric: str
Parameters for linkage algorithm, default
method='single'
andmetric='euclidean'
.- low_bound, up_bound : float
Respectively minimum and maximum value of weights, such that low_bound \(\leq w_i \leq\) up_bound \(\forall i\). Default is 0 and 1.
Returns: - np.ndarray
Vecotr of weights computed by HRP algorithm.
Notes
Hierarchical Risk Parity algorithm is developed by Marco Lopez de Prado [2]. First step is clustering and second step is allocating weights.
References
[2] https://ssrn.com/abstract=2708678