action portfoliooptimizer_post_portfolio_analysis_contributions_risk { label: "Risk Contributions" description: "Perform a risk contribution analysis of one or several portfolio(s), optionally using groups of assets.\n\nReferences\n* Carl R. Bacon, Practical Portfolio Performance Measurement and Attribution\n" provider: portfoliooptimizer method: POST path: "/portfolio/analysis/contributions/risk" encoding: json input: { type: "object" required: ["assets", "assetsCovarianceMatrix", "portfolios"] 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" } } } assetsGroups: { type: "array" items: { type: "array" description: "assetsGroups[k] is the indexes of the assets belonging to the assets group k" items: { type: "integer" } } } portfolios: { type: "array" items: { 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" } } } } } } } output: { type: "object" required: ["portfolios"] properties: { portfolios: { type: "array" items: { type: "object" required: ["assetsRiskContributions"] properties: { assetsGroupsRiskContributions: { type: "array" description: "assetsGroupsRiskContributions[k] is the risk contribution of the group of assets k to the risk of the portfolio" items: { type: "number" } } assetsRiskContributions: { type: "array" description: "assetsRiskContributions[i] is the risk contribution of the asset i to the risk of the portfolio" items: { type: "number" } } } } } } } }