action portfoliooptimizer_post_portfolio_optimization_hierarchical_risk_parity { label: "Hierarchical Risk Parity Portfolio" description: "Compute the asset weights of the hierarchical risk parity portfolio, optionally subject to: \n* Minimum and maximum weights constraints\n* Minimum and maximum portfolio exposure constraints\n\nReferences\n * [Lopez de Prado, M. (2016). Building diversified portfolios that outperform out-of-sample. Journal of Portfolio Management, 42(4), 59–69](https://jpm.pm-research.com/content/42/4/59)\n * [Johann Pfitzinger & Nico Katzke, 2019. A constrained hierarchical risk parity algorithm with cluster-based capital allocation. Working Papers 14/2019, Stellenbosch University, Department of Economics](https://ideas.repec.org/p/sza/wpaper/wpapers328.html)\n" provider: portfoliooptimizer method: POST path: "/portfolio/optimization/hierarchical-risk-parity" encoding: json input: { type: "object" required: ["assets", "assetsCovarianceMatrix"] properties: { assets: { type: "integer" description: "The number of assets" } assetsCovarianceMatrix: { type: "array" description: "assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j" items: { type: "array" items: { type: "number" } } } clusteringMethod: { type: "string" description: "The hierarchical clustering method to use" enum: ["singleLinkage", "averageLinkage", "completeLinkage", "wardLinkage"] } clusteringOrdering: { type: "string" description: "The order to impose on the hierarchical clustering tree leaves" enum: ["r-hclust", "optimal"] } constraints: { type: "object" properties: { maximumAssetsWeights: { type: "array" description: "maximumAssetsWeights[i] is the maximum weight of the asset i in the portfolio, in percentage" items: { type: "number" } } maximumPortfolioExposure: { type: "number" description: "The maximum portfolio exposure; must be higher than or equal to minimumPortfolioExposure" } minimumAssetsWeights: { type: "array" description: "minimumAssetsWeights[i] is the minimum weight of the asset i in the portfolio, in percentage" items: { type: "number" } } minimumPortfolioExposure: { type: "number" description: "The minimum portfolio exposure; must be lower than or equal to maximumPortfolioExposure" } } } } } output: { type: "object" required: ["assetsWeights"] properties: { assetsWeights: { type: "array" description: "assetsWeights[i] is the weight of the asset i in the portfolio, in percentage" items: { type: "number" } } } } }