HRP: Hierarchical Risk Parity portfolio

View source: R/HRP.R

HRPR Documentation

Hierarchical Risk Parity portfolio

Description

Computes optimal HRP portfolio with full investment and weight constraints.

Usage

HRP(sigma, UB = NULL, LB = NULL, tau = 0, ...)

Arguments

sigma

a (N \times N) covariance matrix.

UB

scalar or (N\times 1) vector of upper bound weight constraint.

LB

scalar or (N\times 1) vector of lower bound weight constraint.

tau

trade-off between naive (0) or cluster-based (1) tree-splitting (see Details).

...

arguments passed to cluster::agnes method.

Details

The argument sigma is a covariance matrix and does not need to be positive definite.

Hierarchical clustering is performed using the cluster-package. If cluster_method == 'DIANA', the function cluster::diana is used to compute a cluster dendrogram, otherwise the function cluster::agnes(., method = cluster_method) is used. Default is single-linkage agglomerative nesting.

By default, HRP constructs a balanced graph by bisecting each cluster at the central location (tau = 0). Alternatively it is possible to split along the actual cluster dendrogram (tau = 1), or to trade-off the objectives by setting 0 < tau < 1. In the latter case, tau is the proportion of nodes on the left and right of the central split from which to select the optimal splitting location (i.e. split at the optimal location that is at most tau\times x N/2 elements from the central split).

Value

A (N \times 1) vector of optimal portfolio weights.

Author(s)

Johann Pfitzinger

References

Lopez de Prado, M. (2016). Building Diversified Portfolios that Outperform Out-of-Sample. SSRN Electronic Journal.

Pfitzinger, J., Katzke, N. (2019). A Constrained Hierarchical Risk Parity Algorithm with Cluster-Based Capital Allocation. Stellenbosch University, Department of Economics. Working Paper 14/2019.

Examples

# Load returns of assets or portfolios
data("Industry_10")
rets <- Industry_10
sigma <- cov(rets)
HRP(sigma, UB = 0.15, tau = 0.5)


jpfitzinger/ClusterPortfolios documentation built on Sept. 27, 2024, 11:18 p.m.