action portfoliooptimizer_post_assets_correlation_matrix_nearest { label: "Nearest Correlation Matrix" description: "Compute the _closest_ - in terms of [the Frobenius norm](https://en.wikipedia.org/wiki/Matrix_norm#Frobenius_norm) - asset correlation matrix to an approximate asset correlation matrix, optionally keeping a selected number of correlations fixed.\n\nReferences\n* [Nicholas J. Higham, Computing the Nearest Correlation Matrix—A Problem from Finance, IMA J. Numer. Anal. 22, 329–343, 2002.](http://www.maths.manchester.ac.uk/~higham/narep/narep369.pdf)\n" provider: portfoliooptimizer method: POST path: "/assets/correlation/matrix/nearest" encoding: json input: { type: "object" required: ["assets", "assetsApproximateCorrelationMatrix"] properties: { assets: { type: "integer" description: "The number of assets" } assetsApproximateCorrelationMatrix: { type: "array" description: "assetsApproximateCorrelationMatrix[i][i] is the approximate correlation between the asset i and the asset j" items: { type: "array" items: { type: "number" } } } assetsFixedCorrelations: { type: "array" description: "assetsFixedCorrelations[k] is the couple of indices (i,j) of the assets i and j for which to keep the approximate correlation assetsApproximateCorrelationMatrix[i][j] fixed" items: { type: "array" items: { type: "integer" } } } } } output: { type: "object" required: ["assetsCorrelationMatrix"] properties: { assetsCorrelationMatrix: { type: "array" description: "assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j" items: { type: "array" items: { type: "number" } } } } } }