@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Portfolio Optimizer
@base https://api.portfoliooptimizer.io/v1
@version 1.0.10
@auth ApiKey X-API-Key in header
@endpoints 229
@hint download_for_search
@toc markets(6), factors(4), assets(114), portfolios(104), portfolio(1)

@group markets
@endpoint GET /markets/indicators/aiae/us
@desc U.S. AIAE
@returns(200) {aiaeIndicator: map{aiaeRegion: str, aiaeComputationDate: str, aiaeReferenceDate: str, aiaeForecasts: [map]}} # OK
@errors {401: Access to the endpoint is not authorized}

@endpoint GET /markets/indicators/naaim-exposure-index
@desc NAAIM Exposure Index
@returns(200) {naaimExposureIndexIndicator: map{naaimExposureIndexComputationDate: str, naaimExposureIndexValues: [map]}} # OK
@errors {401: Access to the endpoint is not authorized}

@endpoint GET /markets/capital-assumptions/usd
@desc USD Capital Market Assumptions
@returns(200) {capitalMarketAssumptions: map{cmaCurrency: str, cmaComputationDate: str, cmaHorizon: str, cmaInstitutions: [str], cmaReferenceDates: map{earliestReferenceDate: str, latestReferenceDate: str}, cmaAssets: [map], cmaAssetsCorrelationMatrixLabels: [str], cmaAssetsCorrelationMatrix: [[num]], cmaAssetsCorrelationMatrixLowerBounds: [[num]], cmaAssetsCorrelationMatrixUpperBounds: [[num]]}} # OK

@endpoint GET /markets/capital-assumptions/eur
@desc EUR Capital Market Assumptions
@returns(200) {capitalMarketAssumptions: map{cmaCurrency: str, cmaComputationDate: str, cmaHorizon: str, cmaInstitutions: [str], cmaReferenceDates: map{earliestReferenceDate: str, latestReferenceDate: str}, cmaAssets: [map], cmaAssetsCorrelationMatrixLabels: [str], cmaAssetsCorrelationMatrix: [[num]], cmaAssetsCorrelationMatrixLowerBounds: [[num]], cmaAssetsCorrelationMatrixUpperBounds: [[num]]}} # OK

@endpoint GET /markets/capital-assumptions/chf
@desc CHF Capital Market Assumptions
@returns(200) {capitalMarketAssumptions: map{cmaCurrency: str, cmaComputationDate: str, cmaHorizon: str, cmaInstitutions: [str], cmaReferenceDates: map{earliestReferenceDate: str, latestReferenceDate: str}, cmaAssets: [map], cmaAssetsCorrelationMatrixLabels: [str], cmaAssetsCorrelationMatrix: [[num]], cmaAssetsCorrelationMatrixLowerBounds: [[num]], cmaAssetsCorrelationMatrixUpperBounds: [[num]]}} # OK

@endpoint GET /markets/indicators/bsrmb/us
@desc U.S. BSRM/B
@returns(200) {bsrmbIndicator: map{bsrmbRegion: str, bsrmbComputationDate: str, bsrmbReferenceDate: str, bsrmbForecasts: [map]}} # OK
@errors {401: Access to the endpoint is not authorized}

@endgroup

@group factors
@endpoint GET /factors/models/fama-french/us
@desc U.S. Fama-French Model
@returns(200) {famaFrenchFactors: map{factorsRegion: str, factorsComputationDate: str, factors: [map]}} # OK
@errors {401: Access to the endpoint is not authorized}

@endpoint GET /factors/models/fama-french/developed-markets
@desc Developed Markets Fama-French Model
@returns(200) {famaFrenchFactors: map{factorsRegion: str, factorsComputationDate: str, factors: [map]}} # OK
@errors {401: Access to the endpoint is not authorized}

@endpoint GET /factors/models/fama-french/emerging-markets
@desc Emerging Markets Fama-French Model
@returns(200) {famaFrenchFactors: map{factorsRegion: str, factorsComputationDate: str, factors: [map]}} # OK
@errors {401: Access to the endpoint is not authorized}

@endpoint POST /factors/residualization
@desc Residualization
@required {factors: [map{factorReturns!: [num], factorResidualization: bool}]}
@returns(200) {factors: [map]} # OK
@example_request {"factors":[{"factorReturns":[0.01,0.02,-0.01],"factorResidualization":true},{"factorReturns":[0.025,0.005,-0.02]}]}

@endgroup

@group assets
@endpoint POST /assets/clustering/hierarchical/correlation-based
@desc Hierarchical Clustering
@required {assets: int # The number of assets, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j}
@optional {clusteringMethod: str(singleLinkage/averageLinkage/completeLinkage/wardLinkage)=wardLinkage # The hierarchical clustering method to use, clusters: int # The number of clusters to group the assets into; if not provided, it is computed using the gap statistic method, as described in the first reference, clusteringSimulations: int=500 # The number of clustering simulations to perform when the number of clusters is computed using the gap statistic method}
@returns(200) {assetsGroups: [[int]]} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.7606306078350177,0.15733356650676536],[0.7606306078350177,1,0.7606306078350177],[0.15733356650676536,0.7606306078350177,1]]}

@endpoint POST /assets/clustering/thresholding/correlation-based
@desc Threshold Clustering
@required {assets: int # The number of assets, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j}
@optional {assetsCorrelationThreshold: num=0.5 # The correlation threshold used to separate similar v.s. dissimilar assets}
@returns(200) {assetsGroups: [[int]]} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.7606306078350177,0.15733356650676536],[0.7606306078350177,1,0.7606306078350177],[0.15733356650676536,0.7606306078350177,1]]}

@endpoint POST /assets/clustering/spectral/correlation-based
@desc Spectral Clustering
@required {assets: int # The number of assets, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j}
@optional {clusteringMethod: str(blockbuster/sponge/spongeSymmetric)=spongeSymmetric # The hierarchical clustering method to use, clusters: int # The number of clusters to group the assets into; if not provided, it is computed using a proprietary procedure, clusteringSimulations: int=500 # The number of clustering simulations to perform when the number of clusters is computed using a proprietary variation of Horn's parallel analysis method, positiveDegreeMatrixRegularizationParameter: num=1 # The regularization parameter applicable to the positive degree matrix, in case the clustering method is either SPONGE or symmetric SPONGE, negativeDegreeMatrixRegularizationParameter: num=1 # The regularization parameter applicable to the positive degree matrix, in case the clustering method is either SPONGE or symmetric SPONGE}
@returns(200) {assetsGroups: [[int]]} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.7606306078350177,0.15733356650676536],[0.7606306078350177,1,0.7606306078350177],[0.15733356650676536,0.7606306078350177,1]]}

@endpoint POST /assets/prices/adjusted
@desc Adjusted Prices
@required {assets: [map{assetPrices!: [map], assetDividends: [map], assetSplits: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"close":2213.4,"date":"2020-08-28"},{"close":498.32,"date":"2020-08-31"},{"close":475.05,"date":"2020-09-01"}],"assetSplits":[{"factor":5,"date":"2020-08-31"}]}]}

@endpoint POST /assets/prices/adjusted/forward
@desc Forward-Adjusted Prices
@required {assets: [map{assetPrices!: [map], assetDividends: [map], assetSplits: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"close":2213.4,"date":"2020-08-28"},{"close":498.32,"date":"2020-08-31"},{"close":475.05,"date":"2020-09-01"}],"assetSplits":[{"factor":5,"date":"2020-08-31"}]}]}

@endpoint POST /assets/returns
@desc Arithmetic Returns
@required {assets: [map{assetPrices!: [num]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[1,2]},{"assetPrices":[2,3,6]}]}

@endpoint POST /assets/returns/logarithmic
@desc Logarithmic Returns
@required {assets: [map{assetPrices!: [num]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[1,2]},{"assetPrices":[2,3,6]}]}

@endpoint POST /assets/returns/mean
@desc Mean Return
@required {assets: [map{assetReturns!: [num]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.1,-0.05]},{"assetReturns":[0,-0.01,0.01]}]}

@endpoint POST /assets/returns/backfilled
@desc Backfilled Returns
@required {assets: [map{assetReturns!: [num]}]}
@optional {assetsReturnsBackfillingMethod: str(betaAdjusting/conditionalSampling/residualsRecycling)=residualsRecycling # The method to backfill (i.e., simulate) missing asset returns}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.05,0.1,0.09,0.18]},{"assetReturns":[0.31,0.14,0.29]}]}

@endpoint POST /assets/returns/transformation/turbulence-partitioned
@desc Turbulence-Partitioned Returns
@returns(200) {partitions: [map]} # OK
@example_request {"assets":[{"assetReturns":[0,0.1,0.05,-0.01,0.025]},{"assetReturns":[0.005,0.05,0.1,-0.02,0]}],"assetsReturnsTurbulenceThresholds":[0.8,0.95]}

@endpoint POST /assets/returns/transformation/exponentially-weighted
@desc Exponentially Weighted Returns
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0,0.1,0.05,-0.01,0.025]},{"assetReturns":[0.005,0.05,0.1,-0.02,0]}],"assetsReturnsDecayFactor":0.94}

@endpoint POST /assets/returns/simulation/bootstrap/empirical
@desc Empirical Bootstrap Simulation
@required {assets: [map{assetReturns!: [num]}]}
@optional {simulations: int=1 # The number of simulations to perform, simulationsLength: int # The number of time period(s) to simulate per simulation; if not provided, defaults to the common length of the assetReturns arrays}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.1,-0.05,0.01,0.025,-0.1]},{"assetReturns":[0,0.01,0.02,-0.01,0.05]}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/simulation/bootstrap/online
@desc Online Bootstrap Simulation
@required {assets: [map{assetReturns!: [num]}]}
@optional {bootstrapPersistenceParameter: num # The value of the persistence parameter beta; if not provided, defaults to the optimal value of the 1st reference, simulations: int=1 # The number of simulations to perform, simulationsLength: int # The number of time period(s) to simulate per simulation; if not provided, defaults to the common length of the assetReturns arrays}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.1,-0.05,0.01,0.025,-0.1]},{"assetReturns":[0,0.01,0.02,-0.01,0.05]}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/simulation/bootstrap/circular
@desc Circular Block Bootstrap Simulation
@required {assets: [map{assetReturns!: [num]}]}
@optional {bootstrapBlockLength: int # The length of the blocks to use, in time periods; if not provided, defaults to the automated rounded circular block length of the 2nd and 3rd references, simulations: int=1 # The number of simulations to perform, simulationsLength: int # The number of time period(s) to simulate per simulation; if not provided, defaults to the common length of the assetReturns arrays}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.1,-0.05,0.01,0.025,-0.1]},{"assetReturns":[0,0.01,0.02,-0.01,0.05]}],"bootstrapBlockLength":2,"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/simulation/bootstrap/stationary
@desc Stationary Block Bootstrap Simulation
@required {assets: [map{assetReturns!: [num]}]}
@optional {bootstrapAverageBlockLength: num # The average length of the blocks to use, in time periods; if not provided, defaults to the automated stationary block length of the 2nd and 3rd references, simulations: int=1 # The number of simulations to perform, simulationsLength: int # The number of time period(s) to simulate per simulation; if not provided, defaults to the common length of the assetReturns arrays}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.1,-0.05,0.01,0.025,-0.1]},{"assetReturns":[0,0.01,0.02,-0.01,0.05]}],"bootstrapAverageBlockLength":2,"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/simulation/monte-carlo/arma-garch
@desc Generalized AutoRegressive Conditional Heteroscedasticity (GARCH(1,1)) Conditional Variance Model
@required {assets: [any]}
@optional {simulations: int=1 # The number of simulations to perform, simulationsLength: int=1 # The number of time period(s) to simulate per simulation}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetReturnsConditionalMeanModel":"constantMean","assetUnconditionalMean":0.1,"assetUnscaledUnconditionalVariance":0.010846980082155452,"assetConditionalVarianceLaggedSquaredResidualCoefficient":0.1545888477866232,"assetConditionalVarianceLaggedConditionalVarianceCoefficient":0.8045921025800893}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/simulation/monte-carlo/arma-ewma
@desc Exponentially Weighted Moving Average (EWMA) Conditional Variance Model
@required {assets: [any]}
@optional {simulations: int=1 # The number of simulations to perform, simulationsLength: int=1 # The number of time period(s) to simulate per simulation}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetReturnsConditionalMeanModel":"constantMean","assetUnconditionalMean":0.010846980082155452,"assetConditionalVarianceDecayFactor":0.97}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/simulation/monte-carlo/gaussian
@desc Gaussian Distribution
@required {assets: [any]}
@optional {simulations: int=1 # The number of simulations to perform, simulationsLength: int=1 # The number of time period(s) to simulate per simulation}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetMean":0.05,"assetStandardDeviation":0.2}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/simulation/monte-carlo/student
@desc Student-t Distribution
@required {assets: [any]}
@optional {simulations: int=1 # The number of simulations to perform, simulationsLength: int=1 # The number of time period(s) to simulate per simulation}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetLocationParameter":0.05,"assetScaleParameter":0.2,"assetShapeParameter":4}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/fitting/generalized-pareto
@desc Generalized Pareto Distribution
@required {assets: [map{assetReturns!: [num], assetReturnsTailLocation: str, assetReturnsTailType: str, assetReturnsTailFittingMethod: str, assetReturnsTailParametersBiasReduction: bool, assetReturnsTailThresholdEstimationMethod: str, assetReturnsTailThreshold: num, assetReturnsTailObservations: int, assetReturnsTailPercentObservations: num}] # assets[i] is the data for the i-th asset}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[-0.01,-0.03,-0.01,0],"assetReturnsTailThresholdEstimationMethod":"manual","assetReturnsTailThreshold":0}]}

@endpoint POST /assets/returns/simulation/monte-carlo/generalized-pareto
@desc Generalized Pareto Distribution
@required {assets: [any]}
@optional {simulations: int=1 # The number of simulations to perform, simulationsLength: int=1 # The number of time period(s) to simulate per simulation}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetLowerTailThreshold":0,"assetLowerTailScaleParameter":1,"assetLowerTailShapeParameter":1}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/fitting/arma-garch
@desc Generalized AutoRegressive Conditional Heteroscedasticity (GARCH(1,1)) Conditional Variance Model
@required {assets: [map{assetReturns!: [num], assetReturnsConditionalMeanModel: str, assetReturnsStandardizedResidualsDistribution: str}] # assets[i] is the data for the i-th asset}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.03,-0.01,0]}]}

@endpoint POST /assets/returns/fitting/arma-ewma
@desc Exponentially Weighted Moving Average (EWMA) Conditional Variance Model
@required {assets: [map{assetReturns!: [num], assetReturnsConditionalMeanModel: str, assetReturnsStandardizedResidualsDistribution: str}] # assets[i] is the data for the i-th asset}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.03,-0.01,0],"assetReturnsConditionalMeanModel":"zeroMean"}]}

@endpoint POST /assets/returns/fitting/gaussian
@desc Gaussian Distribution
@required {assets: [map{assetReturns!: [num]}] # assets[i] is the data for the i-th asset}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.03,-0.01,0]}]}

@endpoint POST /assets/returns/fitting/student
@desc Student-t Distribution
@required {assets: [map{assetReturns!: [num]}] # assets[i] is the data for the i-th asset}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.03,-0.01,0]}]}

@endpoint POST /assets/returns/simulation/monte-carlo/gaussian/mixture
@desc Gaussian Mixture Distribution
@required {assets: [any]}
@optional {simulations: int=1 # The number of simulations to perform, simulationsLength: int=1 # The number of time period(s) to simulate per simulation}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetReturnsMixtureComponents":[{"assetReturnsMixtureComponentWeight":0.6,"assetReturnsMixtureComponentMean":0,"assetReturnsMixtureComponentStandardDeviation":0.2},{"assetReturnsMixtureComponentWeight":0.4,"assetReturnsMixtureComponentMean":0.05,"assetReturnsMixtureComponentStandardDeviation":0.1}]}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/fitting/gaussian/mixture
@desc Gaussian Mixture Distribution
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.03,-0.01,0]}]}

@endpoint POST /assets/returns/fitting/gaussian/mixture/multivariate
@desc Multivariate Gaussian Mixture Distribution
@returns(200) {assets: int, assetsReturnsMixtureComponents: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.03,-0.01,0]},{"assetReturns":[0.02,-0.03,0.01,0.005]}]}

@endpoint POST /assets/returns/simulation/monte-carlo/gaussian/multivariate
@desc Multivariate Gaussian Distribution
@returns(200) {simulations: [map]} # OK
@example_request {"assets":2,"assetsMeans":[0.05,0],"assetsCovarianceMatrix":[[0.04,0],[0,0.04]],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/fitting/gaussian/multivariate
@desc Multivariate Gaussian Distribution
@required {assets: [map{assetReturns!: [num]}] # assets[i] is the data for the i-th asset}
@returns(200) {assets: int, assetsMeans: [num], assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.03,-0.01,0]},{"assetReturns":[0.02,0.001,-0.002,0.01]}]}

@endpoint POST /assets/returns/simulation/monte-carlo/gaussian/mixture/multivariate
@desc Multivariate Gaussian Mixture Distribution
@required {assets: int # The number of assets, assetsReturnsMixtureComponents: [map{assetsReturnsMixtureComponentWeight!: num, assetsReturnsMixtureComponentMeans!: [num], assetsReturnsMixtureComponentCovarianceMatrix!: [[num]]}] # assetsReturnsMixtureComponents[i] is the data for the i-th component of the multivariate Gaussian mixture distribution}
@optional {simulations: int=1 # The number of simulations to perform, simulationsLength: int=1 # The number of time period(s) to simulate per simulation}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":2,"assetsReturnsMixtureComponents":[{"assetsReturnsMixtureComponentWeight":0.6,"assetsReturnsMixtureComponentMeans":[0,0],"assetsReturnsMixtureComponentCovarianceMatrix":[[0.04,0],[0,0.04]]},{"assetsReturnsMixtureComponentWeight":0.4,"assetsReturnsMixtureComponentMeans":[0.05,0.05],"assetsReturnsMixtureComponentCovarianceMatrix":[[0.01,0],[0,0.01]]}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/simulation/monte-carlo/cornish-fisher
@desc Cornish-Fisher Distribution
@required {assets: [any]}
@optional {simulations: int=1 # The number of simulations to perform, simulationsLength: int=1 # The number of time period(s) to simulate per simulation}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetMean":0.05,"assetStandardDeviation":0.2,"assetSkewness":0.5,"assetExcessKurtosis":1}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/returns/fitting/cornish-fisher
@desc Cornish-Fisher Distribution
@required {assets: [map{assetReturns!: [num]}] # assets[i] is the data for the i-th asset}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.03,-0.01,0]}]}

@endpoint POST /assets/returns/simulation/monte-carlo/cornish-fisher/corrected
@desc Corrected Cornish-Fisher Distribution
@required {assets: [any]}
@optional {simulations: int=1 # The number of simulations to perform, simulationsLength: int=1 # The number of time period(s) to simulate per simulation}
@returns(200) {simulations: [map]} # OK
@errors {500: Failed computation of the Cornish-Fisher skewness and (excess) kurtosis parameters corresponding to the asset skewness and (excess) kurtosis}
@example_request {"assets":[{"assetMean":0.05,"assetStandardDeviation":0.2,"assetSkewness":0.5,"assetExcessKurtosis":1}],"simulations":5,"simulationsLength":4}

@endpoint POST /assets/covariance/matrix
@desc Covariance Matrix
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":2,"assetsCorrelationMatrix":[[1,-0.5],[-0.5,1]],"assetsVolatilities":[0.1,0.05]}

@endpoint POST /assets/covariance/matrix/estimation/empirical
@desc Empirical Covariance Matrix
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/covariance/matrix/estimation/distance
@desc Distance Covariance Matrix
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/covariance/matrix/estimation/empirical/shrunk
@desc Linearly Shrunk Empirical Covariance Matrix
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}],"shrinkageTarget":"constantVarianceCovariance"}

@endpoint POST /assets/covariance/matrix/estimation/empirical/shrunk/clustering-based
@desc Clustering-Based Linearly Shrunk Empirical Covariance Matrix
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01695979899,0.00264713668,0.0007040394262,0.004221264621]},{"assetReturns":[0.02669404517,0.001,0.001248751249,-0.003242703916]},{"assetReturns":[0.02566735113,0.006006006006,0.003980099502,-0.008919722498]}],"assetsGroups":[[1],[2,3]],"shrinkageTarget":"constantVarianceCovariance"}

@endpoint POST /assets/covariance/matrix/estimation/gerber
@desc Gerber Covariance Matrix
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/covariance/matrix/estimation/empirical/exponentially-weighted
@desc Exponentially Weighted Empirical Covariance Matrix
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.01,0.02,0.01]},{"assetReturns":[-0.02,-0.02,-0.04,-0.02]}],"assetsReturnsDecayFactor":0.5}

@endpoint POST /assets/covariance/matrix/forecast/ewma
@desc Exponentially Weighted Moving Average Model (EWMA)
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}]},{"assetPrices":[{"date":"2020-01-01","close":5.08},{"date":"2020-01-02","close":5.11},{"date":"2020-01-03","close":5.09},{"date":"2020-01-04","close":5.1},{"date":"2020-01-05","close":5.11},{"date":"2020-01-06","close":5.16},{"date":"2020-01-07","close":5.22},{"date":"2020-01-08","close":5.23},{"date":"2020-01-09","close":5.32},{"date":"2020-01-10","close":5.3}]}],"covarianceForecastHorizon":2}

@endpoint POST /assets/covariance/matrix/forecast/ewma/iterated
@desc Iterated Exponentially Weighted Moving Average Model (IEWMA)
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}]},{"assetPrices":[{"date":"2020-01-01","close":5.08},{"date":"2020-01-02","close":5.11},{"date":"2020-01-03","close":5.09},{"date":"2020-01-04","close":5.1},{"date":"2020-01-05","close":5.11},{"date":"2020-01-06","close":5.16},{"date":"2020-01-07","close":5.22},{"date":"2020-01-08","close":5.23},{"date":"2020-01-09","close":5.32},{"date":"2020-01-10","close":5.3}]}],"covarianceForecastHorizon":2}

@endpoint POST /assets/correlation/matrix/forecast/ewma/iterated
@desc Iterated Exponentially Weighted Moving Average Model (IEWMA)
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}]},{"assetPrices":[{"date":"2020-01-01","close":5.08},{"date":"2020-01-02","close":5.11},{"date":"2020-01-03","close":5.09},{"date":"2020-01-04","close":5.1},{"date":"2020-01-05","close":5.11},{"date":"2020-01-06","close":5.16},{"date":"2020-01-07","close":5.22},{"date":"2020-01-08","close":5.23},{"date":"2020-01-09","close":5.32},{"date":"2020-01-10","close":5.3}]}],"correlationForecastHorizon":2}

@endpoint POST /assets/covariance/matrix/forecast/sma
@desc Simple Moving Average Model (SMA)
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}]},{"assetPrices":[{"date":"2020-01-01","close":5.08},{"date":"2020-01-02","close":5.11},{"date":"2020-01-03","close":5.09},{"date":"2020-01-04","close":5.1},{"date":"2020-01-05","close":5.11},{"date":"2020-01-06","close":5.16},{"date":"2020-01-07","close":5.22},{"date":"2020-01-08","close":5.23},{"date":"2020-01-09","close":5.32},{"date":"2020-01-10","close":5.3}]}],"covarianceProxyWindowSize":2,"covarianceForecastHorizon":1}

@endpoint POST /assets/covariance/matrix/forecast/average-oracle
@desc Average Oracle Method (AO)
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}]},{"assetPrices":[{"date":"2020-01-01","close":5.08},{"date":"2020-01-02","close":5.11},{"date":"2020-01-03","close":5.09},{"date":"2020-01-04","close":5.1},{"date":"2020-01-05","close":5.11},{"date":"2020-01-06","close":5.16},{"date":"2020-01-07","close":5.22},{"date":"2020-01-08","close":5.23},{"date":"2020-01-09","close":5.32},{"date":"2020-01-10","close":5.3}]}],"covarianceProxyWindowSize":5,"covarianceForecastHorizon":2}

@endpoint POST /assets/correlation/matrix/forecast/ewma
@desc Exponentially Weighted Moving Average Model (EWMA)
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}]},{"assetPrices":[{"date":"2020-01-01","close":5.08},{"date":"2020-01-02","close":5.11},{"date":"2020-01-03","close":5.09},{"date":"2020-01-04","close":5.1},{"date":"2020-01-05","close":5.11},{"date":"2020-01-06","close":5.16},{"date":"2020-01-07","close":5.22},{"date":"2020-01-08","close":5.23},{"date":"2020-01-09","close":5.32},{"date":"2020-01-10","close":5.3}]}],"correlationForecastHorizon":2}

@endpoint POST /assets/correlation/matrix/forecast/sma
@desc Simple Moving Average Model (SMA)
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}]},{"assetPrices":[{"date":"2020-01-01","close":5.08},{"date":"2020-01-02","close":5.11},{"date":"2020-01-03","close":5.09},{"date":"2020-01-04","close":5.1},{"date":"2020-01-05","close":5.11},{"date":"2020-01-06","close":5.16},{"date":"2020-01-07","close":5.22},{"date":"2020-01-08","close":5.23},{"date":"2020-01-09","close":5.32},{"date":"2020-01-10","close":5.3}]}],"covarianceProxyWindowSize":2,"correlationForecastHorizon":1}

@endpoint POST /assets/correlation/matrix/forecast/average-oracle
@desc Average Oracle Method (AO)
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}]},{"assetPrices":[{"date":"2020-01-01","close":5.08},{"date":"2020-01-02","close":5.11},{"date":"2020-01-03","close":5.09},{"date":"2020-01-04","close":5.1},{"date":"2020-01-05","close":5.11},{"date":"2020-01-06","close":5.16},{"date":"2020-01-07","close":5.22},{"date":"2020-01-08","close":5.23},{"date":"2020-01-09","close":5.32},{"date":"2020-01-10","close":5.3}]}],"covarianceProxyWindowSize":5,"correlationForecastHorizon":2}

@endpoint POST /assets/covariance/matrix/validation
@desc Covariance Matrix Validation
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j}
@returns(200) {message: str} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.00035,-0.00035],[-0.00035,0.00035]]}

@endpoint POST /assets/returns/standard-deviation
@desc Standard Deviation
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/volatility/estimation/close-to-close
@desc Close-to-Close Volatility
@required {assets: [map{assetPrices!: [map], assetReturnsDemeaning: bool}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}]}]}

@endpoint POST /assets/volatility/estimation/garman-klass
@desc Garman-Klass Volatility
@required {assets: [map{assetPrices!: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","open":3.18,"high":3.18,"low":3.08,"close":3.08},{"date":"2020-01-02","open":3.09,"high":3.15,"low":3.09,"close":3.11},{"date":"2020-01-03","open":3.11,"high":3.12,"low":3.08,"close":3.09},{"date":"2020-01-04","open":3.09,"high":3.12,"low":3.07,"close":3.1},{"date":"2020-01-05","open":3.1,"high":3.12,"low":3.08,"close":3.11},{"date":"2020-01-06","open":3.12,"high":3.17,"low":3.1,"close":3.16},{"date":"2020-01-07","open":3.16,"high":3.23,"low":3.14,"close":3.22},{"date":"2020-01-08","open":3.23,"high":3.29,"low":3.2,"close":3.23},{"date":"2020-01-09","open":3.23,"high":3.33,"low":3.22,"close":3.32},{"date":"2020-01-10","open":3.32,"high":3.33,"low":3.28,"close":3.3}]}]}

@endpoint POST /assets/volatility/estimation/garman-klass/jump-adjusted
@desc Garman-Klass Volatility (jump-adjusted)
@required {assets: [map{assetPrices!: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","open":3.18,"high":3.18,"low":3.08,"close":3.08},{"date":"2020-01-02","open":3.09,"high":3.15,"low":3.09,"close":3.11},{"date":"2020-01-03","open":3.11,"high":3.12,"low":3.08,"close":3.09},{"date":"2020-01-04","open":3.09,"high":3.12,"low":3.07,"close":3.1},{"date":"2020-01-05","open":3.1,"high":3.12,"low":3.08,"close":3.11},{"date":"2020-01-06","open":3.12,"high":3.17,"low":3.1,"close":3.16},{"date":"2020-01-07","open":3.16,"high":3.23,"low":3.14,"close":3.22},{"date":"2020-01-08","open":3.23,"high":3.29,"low":3.2,"close":3.23},{"date":"2020-01-09","open":3.23,"high":3.33,"low":3.22,"close":3.32},{"date":"2020-01-10","open":3.32,"high":3.33,"low":3.28,"close":3.3}]}]}

@endpoint POST /assets/volatility/estimation/garman-klass/original
@desc Garman-Klass Volatility (original)
@required {assets: [map{assetPrices!: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","open":3.18,"high":3.18,"low":3.08,"close":3.08},{"date":"2020-01-02","open":3.09,"high":3.15,"low":3.09,"close":3.11},{"date":"2020-01-03","open":3.11,"high":3.12,"low":3.08,"close":3.09},{"date":"2020-01-04","open":3.09,"high":3.12,"low":3.07,"close":3.1},{"date":"2020-01-05","open":3.1,"high":3.12,"low":3.08,"close":3.11},{"date":"2020-01-06","open":3.12,"high":3.17,"low":3.1,"close":3.16},{"date":"2020-01-07","open":3.16,"high":3.23,"low":3.14,"close":3.22},{"date":"2020-01-08","open":3.23,"high":3.29,"low":3.2,"close":3.23},{"date":"2020-01-09","open":3.23,"high":3.33,"low":3.22,"close":3.32},{"date":"2020-01-10","open":3.32,"high":3.33,"low":3.28,"close":3.3}]}]}

@endpoint POST /assets/volatility/estimation/garman-klass/original/jump-adjusted
@desc Garman-Klass Volatility (original, jump-adjusted)
@required {assets: [map{assetPrices!: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","open":3.18,"high":3.18,"low":3.08,"close":3.08},{"date":"2020-01-02","open":3.09,"high":3.15,"low":3.09,"close":3.11},{"date":"2020-01-03","open":3.11,"high":3.12,"low":3.08,"close":3.09},{"date":"2020-01-04","open":3.09,"high":3.12,"low":3.07,"close":3.1},{"date":"2020-01-05","open":3.1,"high":3.12,"low":3.08,"close":3.11},{"date":"2020-01-06","open":3.12,"high":3.17,"low":3.1,"close":3.16},{"date":"2020-01-07","open":3.16,"high":3.23,"low":3.14,"close":3.22},{"date":"2020-01-08","open":3.23,"high":3.29,"low":3.2,"close":3.23},{"date":"2020-01-09","open":3.23,"high":3.33,"low":3.22,"close":3.32},{"date":"2020-01-10","open":3.32,"high":3.33,"low":3.28,"close":3.3}]}]}

@endpoint POST /assets/volatility/estimation/parkinson
@desc Parkinson Volatility
@required {assets: [map{assetPrices!: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","high":3.18,"low":3.08},{"date":"2020-01-02","high":3.15,"low":3.09},{"date":"2020-01-03","high":3.12,"low":3.08},{"date":"2020-01-04","high":3.12,"low":3.07},{"date":"2020-01-05","high":3.12,"low":3.08},{"date":"2020-01-06","high":3.17,"low":3.1},{"date":"2020-01-07","high":3.23,"low":3.14},{"date":"2020-01-08","high":3.29,"low":3.2},{"date":"2020-01-09","high":3.33,"low":3.22},{"date":"2020-01-10","high":3.33,"low":3.28}]}]}

@endpoint POST /assets/volatility/estimation/parkinson/jump-adjusted
@desc Parkinson Volatility (jump-adjusted)
@required {assets: [map{assetPrices!: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","open":3.18,"high":3.18,"low":3.08,"close":3.08},{"date":"2020-01-02","open":3.09,"high":3.15,"low":3.09,"close":3.11},{"date":"2020-01-03","open":3.11,"high":3.12,"low":3.08,"close":3.09},{"date":"2020-01-04","open":3.09,"high":3.12,"low":3.07,"close":3.1},{"date":"2020-01-05","open":3.1,"high":3.12,"low":3.08,"close":3.11},{"date":"2020-01-06","open":3.12,"high":3.17,"low":3.1,"close":3.16},{"date":"2020-01-07","open":3.16,"high":3.23,"low":3.14,"close":3.22},{"date":"2020-01-08","open":3.23,"high":3.29,"low":3.2,"close":3.23},{"date":"2020-01-09","open":3.23,"high":3.33,"low":3.22,"close":3.32},{"date":"2020-01-10","open":3.32,"high":3.33,"low":3.28,"close":3.3}]}]}

@endpoint POST /assets/volatility/estimation/rogers-satchell
@desc Rogers-Satchell Volatility
@required {assets: [map{assetPrices!: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","open":3.18,"high":3.18,"low":3.08,"close":3.08},{"date":"2020-01-02","open":3.09,"high":3.15,"low":3.09,"close":3.11},{"date":"2020-01-03","open":3.11,"high":3.12,"low":3.08,"close":3.09},{"date":"2020-01-04","open":3.09,"high":3.12,"low":3.07,"close":3.1},{"date":"2020-01-05","open":3.1,"high":3.12,"low":3.08,"close":3.11},{"date":"2020-01-06","open":3.12,"high":3.17,"low":3.1,"close":3.16},{"date":"2020-01-07","open":3.16,"high":3.23,"low":3.14,"close":3.22},{"date":"2020-01-08","open":3.23,"high":3.29,"low":3.2,"close":3.23},{"date":"2020-01-09","open":3.23,"high":3.33,"low":3.22,"close":3.32},{"date":"2020-01-10","open":3.32,"high":3.33,"low":3.28,"close":3.3}]}]}

@endpoint POST /assets/volatility/estimation/rogers-satchell/jump-adjusted
@desc Rogers-Satchell Volatility (jump-adjusted)
@required {assets: [map{assetPrices!: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","open":3.18,"high":3.18,"low":3.08,"close":3.08},{"date":"2020-01-02","open":3.09,"high":3.15,"low":3.09,"close":3.11},{"date":"2020-01-03","open":3.11,"high":3.12,"low":3.08,"close":3.09},{"date":"2020-01-04","open":3.09,"high":3.12,"low":3.07,"close":3.1},{"date":"2020-01-05","open":3.1,"high":3.12,"low":3.08,"close":3.11},{"date":"2020-01-06","open":3.12,"high":3.17,"low":3.1,"close":3.16},{"date":"2020-01-07","open":3.16,"high":3.23,"low":3.14,"close":3.22},{"date":"2020-01-08","open":3.23,"high":3.29,"low":3.2,"close":3.23},{"date":"2020-01-09","open":3.23,"high":3.33,"low":3.22,"close":3.32},{"date":"2020-01-10","open":3.32,"high":3.33,"low":3.28,"close":3.3}]}]}

@endpoint POST /assets/volatility/estimation/yang-zhang
@desc Yang-Zhang Volatility
@required {assets: [map{assetPrices!: [map]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","open":3.18,"high":3.18,"low":3.08,"close":3.08},{"date":"2020-01-02","open":3.09,"high":3.15,"low":3.09,"close":3.11},{"date":"2020-01-03","open":3.11,"high":3.12,"low":3.08,"close":3.09},{"date":"2020-01-04","open":3.09,"high":3.12,"low":3.07,"close":3.1},{"date":"2020-01-05","open":3.1,"high":3.12,"low":3.08,"close":3.11},{"date":"2020-01-06","open":3.12,"high":3.17,"low":3.1,"close":3.16},{"date":"2020-01-07","open":3.16,"high":3.23,"low":3.14,"close":3.22},{"date":"2020-01-08","open":3.23,"high":3.29,"low":3.2,"close":3.23},{"date":"2020-01-09","open":3.23,"high":3.33,"low":3.22,"close":3.32},{"date":"2020-01-10","open":3.32,"high":3.33,"low":3.28,"close":3.3}]}]}

@endpoint POST /assets/volatility/forecast/sma
@desc Simple Moving Average Model (SMA)
@required {assets: [map{assetPrices: [map], assetVarianceProxies: [any], varianceProxy: str, varianceProxyWindowSize!: int, volatilityForecastHorizon: int}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}],"varianceProxyWindowSize":5,"volatilityForecastHorizon":20}]}

@endpoint POST /assets/volatility/forecast/ewma
@desc Exponentially Weighted Moving Average Model (EWMA)
@required {assets: [map{assetPrices: [map], assetVarianceProxies: [any], varianceProxy: str, varianceProxyDecayFactor: any, oneOf: any, volatilityForecastHorizon: int}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}],"varianceProxyDecayFactor":0.94,"volatilityForecastHorizon":20}]}

@endpoint POST /assets/volatility/forecast/garch
@desc Generalized AutoRegressive Conditional Heteroscedasticity Model (GARCH(1,1))
@required {assets: [map{assetPrices: [map], assetVarianceProxies: [any], varianceProxy: str, volatilityForecastHorizon: int}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}],"volatilityForecastHorizon":5}]}

@endpoint POST /assets/volatility/forecast/har
@desc Heterogeneous AutoRegressive Model (HAR)
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}],"volatilityForecastHorizon":5,"varianceProxyLogTransformation":true,"varianceProxyLags":[1,5]}]}

@endpoint POST /assets/volatility/forecast/hexp
@desc Heterogeneous Exponential Model (HExp)
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","close":3.08},{"date":"2020-01-02","close":3.11},{"date":"2020-01-03","close":3.09},{"date":"2020-01-04","close":3.1},{"date":"2020-01-05","close":3.11},{"date":"2020-01-06","close":3.16},{"date":"2020-01-07","close":3.22},{"date":"2020-01-08","close":3.23},{"date":"2020-01-09","close":3.32},{"date":"2020-01-10","close":3.3}],"volatilityForecastHorizon":5,"varianceProxyLogTransformation":true,"varianceProxyCentersOfMass":[1,5]}]}

@endpoint POST /assets/returns/variance
@desc Variance
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/returns/skewness
@desc Skewness
@required {assets: [map{assetReturns!: [num]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/returns/kurtosis
@desc Kurtosis
@required {assets: [map{assetReturns!: [num]}]}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/indicators/effective-rank
@desc Effective Rank
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j}
@returns(200) {assetsEffectiveRank: num} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.00035,-0.00035],[-0.00035,0.00035]]}

@endpoint POST /assets/indicators/turbulence-index
@desc Turbulence Index
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j over an historical reference period, assetsMeanReturns: [num] # assetsMeanReturns[i] is the mean return of asset i over an historical reference period, in percentage, assetsReturns: [num] # assetsReturns[i] is the return of asset i over a period different from the historical reference period in the same frequency as assetsMeanReturns[i], in percentage}
@returns(200) {assetsTurbulenceIndex: num} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[9,1],[1,1]],"assetsMeanReturns":[1,1],"assetsReturns":[1,0]}

@endpoint POST /assets/indicators/absorption-ratio
@desc Absorption Ratio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j}
@optional {assetsCovarianceMatrixEigenvectors: map{eigenvectorsRetained: int}}
@returns(200) {assetsAbsorptionRatio: num} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[9,1],[1,1]]}

@endpoint POST /assets/indicators/momentum/sign
@desc Sign Momentum
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03],"signMomentumFormationPeriod":2},{"assetReturns":[0.01,0,0.02],"signMomentumFormationPeriod":3}]}

@endpoint POST /assets/indicators/momentum
@desc Momentum
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03],"momentumFormationPeriod":3},{"assetReturns":[0.01,0,0.02],"momentumFormationPeriod":1}]}

@endpoint POST /assets/indicators/momentum/rank
@desc Rank Momentum
@returns(200) {assetsRankMomentum: [num]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,0.01]}],"rankMomentumFormationPeriod":1}

@endpoint POST /assets/indicators/information-discreteness
@desc Information Discreteness
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03],"informationDiscretenessFormationPeriod":3},{"assetReturns":[0.01,0,0.02],"informationDiscretenessFormationPeriod":1}]}

@endpoint POST /assets/indicators/trend-clarity
@desc Trend Clarity
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03],"trendClarityFormationPeriod":3},{"assetReturns":[0.01,0,0.02],"trendClarityFormationPeriod":1}]}

@endpoint POST /assets/indicators/market-rank
@desc Market Rank
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j}
@optional {assetsCovarianceMatrixEigenvectors: map{eigenvectorsRetained: int}}
@returns(200) {assetsMarketRank: num} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[9,1],[1,1]]}

@endpoint POST /assets/indicators/entropic-connectedness
@desc Entropic Connectedness
@required {assets: int, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j}
@optional {assetsEntropicConnectednessOrder: num=2 # The order of the Renyi entropy to use; must be different from 1}
@returns(200) {assetsEntropicConnectedness: num} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.5,0.9],[0.5,1,0.7],[0.9,0.7,1]]}

@endpoint POST /assets/correlation/matrix
@desc Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/correlation/matrix/estimation/spearman
@desc Spearman Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/correlation/matrix/estimation/kendall
@desc Kendall Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/correlation/matrix/estimation/popov
@desc Popov Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetPrices":[{"date":"2020-01-01","open":102.69403132,"high":103.42677916,"low":102.43285186,"close":103.18011252},{"date":"2020-01-02","open":103.22364086,"high":103.49933316,"low":103.02775391,"close":103.12207135},{"date":"2020-01-03","open":103.21638952,"high":103.33246098,"low":102.52717003,"close":102.74481027}]},{"assetPrices":[{"date":"2020-01-01","open":54.53117847,"high":54.71394413,"low":54.53117847,"close":54.61037692},{"date":"2020-01-02","open":54.61646911,"high":54.63468475,"low":54.55554723,"close":54.60428473},{"date":"2020-01-03","open":54.65302224,"high":54.94544729,"low":54.58600817,"close":54.87843321}]}]}

@endpoint POST /assets/correlation/matrix/estimation/gerber
@desc Gerber Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/correlation/matrix/estimation/chatterjee
@desc Chatterjee Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/correlation/matrix/estimation/lancaster
@desc Lancaster Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/correlation/matrix/estimation/fechner
@desc Fechner Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/correlation/matrix/estimation/distance
@desc Distance Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/correlation/matrix/estimation/empirical
@desc Empirical Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}]}

@endpoint POST /assets/correlation/matrix/estimation/empirical/shrunk
@desc Shrunk Empirical Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,-0.03]}],"shrinkageTarget":"constantCorrelation"}

@endpoint POST /assets/correlation/matrix/estimation/empirical/shrunk/clustering-based
@desc Clustering-Based Shrunk Empirical Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01695979899,0.00264713668,0.0007040394262,0.004221264621]},{"assetReturns":[0.02669404517,0.001,0.001248751249,-0.003242703916]},{"assetReturns":[0.02566735113,0.006006006006,0.003980099502,-0.008919722498]}],"assetsGroups":[[1],[2,3]],"shrinkageTarget":"constantCorrelation"}

@endpoint POST /assets/correlation/matrix/estimation/empirical/exponentially-weighted
@desc Exponentially Weighted Empirical Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.01,0.02,0.01]},{"assetReturns":[-0.02,-0.02,-0.04,-0.02]}],"assetsReturnsDecayFactor":0.5}

@endpoint POST /assets/correlation/matrix/validation
@desc Correlation Matrix Validation
@required {assets: int # The number of assets, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j}
@returns(200) {message: str} # OK
@example_request {"assets":2,"assetsCorrelationMatrix":[[1,-0.00035],[-0.00035,1]]}

@endpoint POST /assets/correlation/matrix/theory-implied
@desc Theory-Implied Correlation Matrix
@required {assets: [map{assetHierarchicalClassification!: [any]}], assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j}
@optional {clusteringMethod: str(singleLinkage/averageLinkage/completeLinkage/wardLinkage)=averageLinkage # The hierarchical clustering method to use}
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":[{"assetHierarchicalClassification":[35,3510,351010,35101010]},{"assetHierarchicalClassification":[20,2030,203020,20302010]}],"assetsCorrelationMatrix":[[1,-0.00035],[-0.00035,1]]}

@endpoint POST /assets/correlation/matrix/random
@desc Random Correlation Matrix
@required {assets: int # The number of assets}
@optional {simulations: int=1 # The number of simulations to perform}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":2}

@endpoint POST /assets/correlation/matrix/perturbed
@desc Perturbed Correlation Matrix
@required {assets: int # The number of assets}
@optional {assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j, noiseLevel: num # The exact level of noise that the coefficients of the asset correlation matrix assetsCorrelationMatrix must be perturbed with; exclusive with maximumNoiseLevel, maximumNoiseLevel: num # The maximum level of noise that the coefficients of the asset correlation matrix assetsCorrelationMatrix must be perturbed with; exclusive with noiseLevel, simulations: int=1 # The number of simulations to perform}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0,0],[0,1,0],[0,0,1]]}

@endpoint POST /assets/correlation/matrix/nearest
@desc Nearest Correlation Matrix
@required {assets: int # The number of assets, assetsApproximateCorrelationMatrix: [[num]] # assetsApproximateCorrelationMatrix[i][i] is the approximate correlation between the asset i and the asset j}
@optional {assetsFixedCorrelations: [[int]] # 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}
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":3,"assetsApproximateCorrelationMatrix":[[1,1,0],[1,1,1],[0,1,1]]}

@endpoint POST /assets/correlation/matrix/completed
@desc Completed Correlation Matrix
@required {assets: int # The number of assets, assetsIncompleteCorrelationMatrix: [[num]] # assetsIncompleteCorrelationMatrix[i][i] is the correlation between the asset i and the asset j (null to indicate an unspecified correlation)}
@optional {assetsCorrelationMatrixCompletionMethod: str(maximumDeterminantCompletion/heuristicCompletion) # The asset correlation matrix completion method to use}
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":3,"assetsIncompleteCorrelationMatrix":[[1,0.95,0.95],[0.95,1,null],[0.95,null,1]]}

@endpoint POST /assets/covariance/matrix/shrunk
@desc Shrunk Covariance Matrix
@required {assets: int, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j, targetCovarianceMatrix: [[num]] # targetCovarianceMatrix[i][j] is the target covariance between the asset i and the asset j, shrinkageFactor: num # The shrinkage factor}
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":3,"assetsCovarianceMatrix":[[0.05,0.02,0],[0.02,0.07,0.5],[0,0.5,0.1]],"targetCovarianceMatrix":[[0.05,0,0],[0,0.02,0],[0,0,0.03]],"shrinkageFactor":0.5}

@endpoint POST /assets/correlation/matrix/aggregated
@desc Aggregated Correlation Matrix
@required {assets: int, assetsGlobalCorrelationMatrix: [[num]] # assetsGlobalCorrelationMatrix[i][j] is the (global) correlation between the asset i and the asset j, assetsLocalCorrelationMatrices: [map{assetsLocalCorrelationMatrix!: [[num]]}] # assetsLocalCorrelationMatrices[k] contains the (local) correlations between the assets of the k-th diagonal block of the asset correlation matrix assetsGlobalCorrelationMatrix}
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":6,"assetsGlobalCorrelationMatrix":[[1,0,0,0.3189,0.4593,0.3272],[0,1,0,0.0958,0.2972,0.0575],[0,0,1,0.3127,0.3845,0.4072],[0.3189,0.0958,0.3127,1,0,0],[0.4593,0.2972,0.3845,0,1,0],[0.3272,0.0575,0.4072,0,0,1]],"assetsLocalCorrelationMatrices":[{"assetsLocalCorrelationMatrix":[[1,0.9548,0.9521],[0.9548,1,0.8875],[0.9521,0.8875,1]]},{"assetsLocalCorrelationMatrix":[[1,0.9446,0.8473],[0.9446,1,0.8235],[0.8473,0.8235,1]]}]}

@endpoint POST /assets/covariance/matrix/aggregated
@desc Aggregated Covariance Matrix
@required {assets: int, assetsGlobalCovarianceMatrix: [[num]] # assetsGlobalCovarianceMatrix[i][j] is the (global) covariance between the asset i and the asset j, assetsLocalCovarianceMatrices: [map{assetsLocalCovarianceMatrix!: [[num]]}] # assetsLocalCovarianceMatrices[k] contains the (local) correlations between the assets of the k-th diagonal block of the asset covariance matrix assetsGlobalCovarianceMatrix}
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":4,"assetsGlobalCovarianceMatrix":[[0.0001185411372307799,0.00005859360165338841,0.00002881702952479082,0.00005891081901532938],[0.00005859360165338841,0.000183567275462732,0.00006508177061247319,0.00009736946242207815],[0.00002881702952479082,0.00006508177061247319,0.0001525718513489824,0.00005905351470443794],[0.00005891081901532938,0.00009736946242207815,0.00005905351470443794,0.0001896025507304725]],"assetsLocalCovarianceMatrices":[{"assetsLocalCovarianceMatrix":[[0.0000185411372307799,0.00001859360165338841],[0.00001859360165338841,0.000783567275462732]]},{"assetsLocalCovarianceMatrix":[[0.0007525718513489824,0.00001905351470443794],[0.00001905351470443794,0.0006896025507304725]]}]}

@endpoint POST /assets/correlation/matrix/shrunk
@desc Shrunk Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.5,0.9],[0.5,1,0.7],[0.9,0.7,1]],"targetCorrelationMatrix":"maximumEquicorrelationMatrix","shrinkageFactor":0.5}

@endpoint POST /assets/correlation/matrix/shrunk/clustering-based
@desc Clustering-Based Shrunk Correlation Matrix
@required {assets: int, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j, targetCorrelationMatrix: str # The shrinkage target correlation matrix, shrinkageFactor: num # The shrinkage factor, assetsGroups: [[int]]}
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":4,"assetsCorrelationMatrix":[[1,0.5,0.5,0],[0.5,1,0.5,0.3],[0.5,0.5,1,-0.1],[0,0.3,-0.1,1]],"assetsGroups":[[1,2],[3],[4]],"targetCorrelationMatrix":"averageBlockEquicorrelationMatrix","shrinkageFactor":0.5}

@endpoint POST /assets/correlation/matrix/estimation/empirical/filtered/random-matrix-theory-based
@desc Random Matrix Theory-Based Filtered Empirical Correlation Matrix
@returns(200) {assetsCorrelationMatrix: [[num]]} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.5,0.9],[0.5,1,0.7],[0.9,0.7,1]],"assetsCorrelationMatrixAspectRatio":0.5}

@endpoint POST /assets/covariance/matrix/estimation/empirical/filtered/random-matrix-theory-based
@desc Random Matrix Theory-Based Filtered Empirical Covariance Matrix
@returns(200) {assetsCovarianceMatrix: [[num]]} # OK
@example_request {"assets":3,"assetsCovarianceMatrix":[[0.05,0.02,0],[0.02,0.07,0.5],[0,0.5,0.1]],"assetsCovarianceMatrixAspectRatio":0.5}

@endpoint POST /assets/correlation/matrix/distance
@desc Correlation Matrix Distance
@required {assets: int, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j, referenceCorrelationMatrix: [[num]] # referenceCorrelationMatrix[i][j] is the reference correlation between the asset i and the asset j}
@optional {distanceMetric: str(euclidean/correlationMatrix/bures)=euclidean # The distance metric to use to compute the distance between the asset correlation matrix and the reference correlation matrix}
@returns(200) {assetsCorrelationMatrixDistance: num} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.5,0.9],[0.5,1,0.7],[0.9,0.7,1]],"referenceCorrelationMatrix":[[1,1,1],[1,1,1],[1,1,1]]}

@endpoint POST /assets/correlation/matrix/informativeness
@desc Correlation Matrix Informativeness
@required {assets: int, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j}
@optional {distanceMetric: str(euclidean/correlationMatrix/bures)=euclidean # The distance metric to use to compute the informativeness of the asset correlation matrix}
@returns(200) {assetsCorrelationMatrixInformativeness: num} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.5,0.9],[0.5,1,0.7],[0.9,0.7,1]]}

@endpoint POST /assets/correlation/matrix/average-correlation
@desc Correlation Matrix Average Correlation
@required {assets: int, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j}
@returns(200) {assetsCorrelationMatrixAverageCorrelation: num} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.5,0.9],[0.5,1,0.7],[0.9,0.7,1]]}

@endpoint POST /assets/correlation/matrix/bounds
@desc Correlation Matrix Bounds
@required {assets: int, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j, assetsGroup: [int] # assetsGroup[k] is the index of the (k+1)-th asset belonging to the selected group of assets}
@returns(200) {assetsCorrelationMatrixLowerBounds: [[num]], assetsCorrelationMatrixUpperBounds: [[num]]} # OK
@example_request {"assets":4,"assetsCorrelationMatrix":[[1,0.5,0.5,0],[0.5,1,0.5,0.3],[0.5,0.5,1,-0.1],[0,0.3,-0.1,1]],"assetsGroup":[3,4]}

@endgroup

@group portfolios
@endpoint POST /portfolios/simulation/random
@desc Random Portfolio Simulation
@required {assets: int # The number of assets}
@optional {simulations: int=1 # The number of simulations to perform, constraints: map{minimumAssets: int, maximumAssets: int, minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":3,"simulations":2}

@endpoint POST /portfolios/simulation/evolution
@desc Portfolio Evolution Simulation
@required {assets: [map{assetPrices!: [num]}], portfolios: [map{assetsWeights!: [num], portfolioRebalancingMethod: str, portfolioRebalancingThreshold: num, portfolioRebalancingThresholdType: str}]}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetPrices":[100,105,110]},{"assetPrices":[15,12.5,11.25]},{"assetPrices":[0.5,0.51,0.49]}],"portfolios":[{"assetsWeights":[1,0,0]},{"assetsWeights":[0,1,0]},{"assetsWeights":[0,0,1]}]}

@endpoint POST /portfolios/simulation/evolution/random
@desc Random Portfolio Evolution Simulation
@required {assets: [map{assetPrices!: [num]}]}
@optional {simulations: int=1 # The number of simulations to perform, portfolioRebalancingMethod: str(noRebalancing/continuousRebalancing/randomRebalancing)=noRebalancing # The method used to rebalance the asset weights of the simulated portfolio at each time t, constraints: map{minimumAssets: int, maximumAssets: int, minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {simulations: [map]} # OK
@example_request {"assets":[{"assetPrices":[100,95,110]},{"assetPrices":[100,105,100]}]}

@endgroup

@group portfolio
@endpoint POST /portfolio/construction/investable
@desc Investable Portfolio
@required {assets: int # The number of assets, portfolioValue: num # The monetary value of the portfolio, assetsPrices: [num] # assetsPrices[i] is the price of the asset i}
@optional {assetsWeights: [num] # assetsWeights[i] is the desired weight of the asset i in the portfolio, in percentage (can be null to indicate no specific desire), assetsGroups: [[int]], assetsGroupsWeights: [num] # assetsGroupsWeights[i] is the desired weight of the assets group k in the portfolio, in percentage (can be null to indicate no specific desire); requires assetsGroups to be present, maximumAssetsGroupsWeights: [num] # maximumAssetsGroupsWeights[k] is the maximum desired weight of the assets group k in the portfolio, in percentage (can be null to indicate no specific desire); requires assetsGroups to be present, assetsSizeLots: [num] # assetsSizeLots[i] is the number of shares by which it is required to purchase the asset i (usual values are 1 if the asset needs to be purchased share by share, 100 if the asset needs to be purchased by an integer multiple of 100 shares, and 1/1000000 - e.g. for Robinhood broker - if the asset can be purchased by fractional shares), assetsMinimumPositions: [num] # assetsMinimumPositions[i] is the minimum number of shares of the asset i that is required to purchase when the asset i is included in the portfolio (usual values are the same as for assetsSizeLots), assetsMinimumNotionalValues: [num] # assetsMinimumNotionalValues[i] is the minimum monetary value that the position in the asset i is required to represent when the asset i is included in the portfolio}
@returns(200) {assetsPositions: [num], assetsWeights: [num]} # OK
@example_request {"assets":3,"assetsPrices":[10,25,500],"assetsWeights":[0.05,0.6,0.35],"portfolioValue":10000}

@endgroup

@group portfolios
@endpoint POST /portfolios/post-optimization/rounding
@desc Portfolio Weights Rounding
@required {portfolios: [map{assets!: int, assetsWeights!: [num], constraints: map}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"assets":3,"assetsWeights":[0.3333333333333333,0,0.6666666666666666]}]}

@endpoint POST /portfolios/replication/index-tracking
@desc Index Tracking Portfolio
@required {assets: [map{assetReturns!: [num]}], benchmarkReturns: [num] # benchmarkReturns[t] is the return of the benchmark at the time t; the benchmarkReturns array must have the same length as all the assetReturns arrays}
@optional {constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0.02,0.03]},{"assetReturns":[-0.01,-0.02,-0.03]}],"benchmarkReturns":[0,0,0]}

@endpoint POST /portfolios/replication/index-tracking/sparse
@desc Sparse Index Tracking Portfolio
@required {assets: [map{assetReturns!: [num]}], benchmarkReturns: [num] # benchmarkReturns[t] is the return of the benchmark at the time t; the benchmarkReturns array must have the same length as all the assetReturns arrays}
@optional {constraints: map{maximumAssets: int, minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":[{"assetReturns":[0.078129363,0.03663478,0.028787879,0.031491869,-0.019533386,-0.042308288,-0.062133001,-0.103910104,-0.027053038,0.082179315,0.004579357,-0.049970429]},{"assetReturns":[0.05289784,0.065017266,0.028012939,-0.019089773,0.025592817,-0.03893898,0.026564726,-0.07927768,-0.033253707,0.090633334,0.04075,-0.044859476]},{"assetReturns":[0.055323183,0.065000264,0.027985908,-0.019018198,0.025635979,-0.038860104,0.026504942,-0.079552638,-0.033599239,0.090526431,0.041004562,-0.044589974]},{"assetReturns":[0.078085397,0.036893028,0.02912706,0.031861707,-0.019134434,-0.041778299,-0.0617737,-0.103650587,-0.026909091,0.082105488,0.005130735,-0.049278492]}],"benchmarkReturns":[0.055518502,0.062009871,0.028003081,-0.013945023,0.020509392,-0.03935567,0.017029792,-0.081809115,-0.032750097,0.089738414,0.037148934,-0.045498531],"constraints":{"maximumAssets":2}}

@endpoint POST /portfolios/analysis/factors/exposures
@desc Factor Exposures
@returns(200) OK
@example_request {"factors":[{"factorReturns":[-0.00414169934,0.01201656108,0.0087181369]},{"factorReturns":[-0.01387258782,-0.01097961581,0.01742002062]}],"portfolios":[{"portfolioReturns":[-0.04302,0.01310372213,0.06482589323]}]}

@endpoint POST /portfolios/analysis/effective-number-of-bets
@desc Effective Number of Bets
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j, portfolios: [map{assetsWeights!: [num]}]}
@optional {factorsComputationMethod: str(principalComponentAnalysis/exactMinimumLinearTorsion/approximateMinimumLinearTorsion)=exactMinimumLinearTorsion # The method used to compute the uncorrelated risk factors from the asset covariance matrix}
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":3,"assetsCovarianceMatrix":[[1,0,0],[0,286.31,100.79],[0,100.79,601.36]],"portfolios":[{"assetsWeights":[10.96,1.06,0.22]}]}

@endpoint POST /portfolios/analysis/effective-number-of-assets
@desc Effective Number of Assets
@required {portfolios: [map{assets!: int, assetsWeights!: [num]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"assets":3,"assetsWeights":[1,0,0]}]}

@endpoint POST /portfolios/analysis/alpha
@desc Jensen's Alpha
@required {benchmarkReturns: [num] # benchmarkReturns[t] is the return of the benchmark at the time t; the benchmarkReturns array must have the same length as all the portfolioReturns arrays, portfolios: [map{portfolioReturns: [num], portfolioValues: [num]}]}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage; exclusive with riskFreeReturns, riskFreeReturns: [num] # riskFreeReturns[t] is the risk-free arithmetic return at the time t; the riskFreeReturns array must have the same length as all the portfolioReturns arrays or the same length minus 1 as all the portfolioValues arrays; exclusive with riskFreeReturn}
@returns(200) {portfolios: [map]} # OK
@example_request {"benchmarkReturns":[0.002,0.025,0.018,-0.011,0.014],"riskFreeReturn":0.01,"portfolios":[{"portfolioReturns":[0.003,0.026,0.011,-0.01,0.015]}]}

@endpoint POST /portfolios/analysis/beta
@desc Beta
@required {benchmarkReturns: [num] # benchmarkReturns[t] is the return of the benchmark at the time t; the benchmarkReturns array must have the same length as all the portfolioReturns arrays, portfolios: [map{portfolioReturns: [num], portfolioValues: [num]}]}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage; exclusive with riskFreeReturns, riskFreeReturns: [num] # riskFreeReturns[t] is the risk-free arithmetic return at the time t; the riskFreeReturns array must have the same length as all the portfolioReturns arrays or the same length minus 1 as all the portfolioValues arrays; exclusive with riskFreeReturn}
@returns(200) {portfolios: [map]} # OK
@example_request {"benchmarkReturns":[0.002,0.025,0.018,-0.011,0.014],"riskFreeReturn":0.01,"portfolios":[{"portfolioReturns":[0.003,0.026,0.011,-0.01,0.015]}]}

@endpoint POST /portfolios/analysis/tracking-error-variance
@desc Tracking Error Variance
@returns(200) {portfolios: [map]} # OK
@example_request {"benchmarkReturns":[0.002,0.025,0.018,-0.011,0.014,0.018,0.014,0.065,-0.015,0.042,-0.006,0.083,0.039,-0.038,-0.062,0.015,-0.048,0.021,0.06,0.056,-0.067,0.019,-0.003,0],"portfolios":[{"portfolioReturns":[0.003,0.026,0.011,-0.01,0.015,0.025,0.016,0.067,-0.014,0.04,-0.005,0.081,0.04,-0.037,-0.061,0.017,-0.049,-0.022,0.07,0.058,-0.065,0.024,-0.005,-0.009]}]}

@endpoint POST /portfolios/analysis/empirical-tracking-error
@desc Empirical Tracking Error
@returns(200) {portfolios: [map]} # OK
@example_request {"benchmarkReturns":[0.002,0.025,0.018,-0.011,0.014,0.018,0.014,0.065,-0.015,0.042,-0.006,0.083,0.039,-0.038,-0.062,0.015,-0.048,0.021,0.06,0.056,-0.067,0.019,-0.003,0],"portfolios":[{"portfolioReturns":[0.003,0.026,0.011,-0.01,0.015,0.025,0.016,0.067,-0.014,0.04,-0.005,0.081,0.04,-0.037,-0.061,0.017,-0.049,-0.022,0.07,0.058,-0.065,0.024,-0.005,-0.009]}]}

@endpoint POST /portfolios/analysis/drawdowns
@desc Drawdown Function
@required {portfolios: [map{portfolioReturns: [num], portfolioValues: [num]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/drawdowns/worst
@desc Worst Drawdowns
@required {portfolios: [map{portfolioReturns: [num], portfolioValues: [num], portfolioWorstDrawdowns: int}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70],"portfolioWorstDrawdowns":2}]}

@endpoint POST /portfolios/analysis/mean-variance/efficient-frontier
@desc Mean-Variance Efficient Frontier
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {portfolios: int=25 # The number of portfolios to compute on the mean-variance efficient frontier, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":2,"assetsMeanReturns":[0.01,0.05],"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"portfolios":3,"constraints":{"minimumAssetsWeights":[0.2,0]}}

@endpoint POST /portfolios/analysis/mean-variance/efficient-frontier/resampling-based
@desc Resampling-Based Mean-Variance Efficient Frontier
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {simulatedEfficientFrontiers: int=128 # The number of efficient frontiers to simulate, simulatedEfficientFrontiersAggregationMethod: str(average/median)=average # The method to aggregate the simulated efficient frontiers, simulatedEfficientFrontiersDiscretizationMethod: str(rankAssociation/lambdaAssociation)=lambdaAssociation # The method to discretize the simulated efficient frontiers, assetsReturnsUncertaintyIntervals: [[num]], assetsStandardDeviationsUncertaintyIntervals: [[num]], assetsCorrelationMatrixUncertaintyLevel: num # The uncertainty level on the coefficients of the asset correlation matrix associated to assetsCovarianceMatrix; defaults to 0.10, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":3,"assetsMeanReturns":[0.01,0.02,0.03],"assetsReturnsUncertaintyIntervals":[[0.009,0.011],[0.02,0.02],[0.027,0.033]],"assetsCovarianceMatrix":[[1,0.3,-0.2],[0.3,1,0.2],[-0.2,0.2,1]],"assetsCorrelationMatrixUncertaintyLevel":0.25,"portfolios":3}

@endpoint POST /portfolios/analysis/mean-variance/minimum-variance-frontier
@desc Mean-Variance Minimum Variance Frontier
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {portfolios: int=25 # The number of portfolios to compute on the mean-variance minimum variance frontier, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":2,"assetsMeanReturns":[0.01,0.05],"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"portfolios":4,"constraints":{"minimumAssetsWeights":[0.2,0]}}

@endpoint POST /portfolios/analysis/returns/semivariance
@desc Semivariance
@required {portfolios: [map{portfolioReturns: [num], portfolioValues!: [num]}]}
@optional {minimalAcceptableReturn: num # The constant minimal acceptable return over the considered time period; exclusive with minimalAcceptableReturns, minimalAcceptableReturns: [num] # minimalAcceptableReturns[t] is the minimal acceptable return at the time t; the minimalAcceptableReturns array must have the same length as all the portfolioReturns arrays or the same length minus 1 as all the portfolioValues arrays; exclusive with minimalAcceptableReturn}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/returns/semideviation
@desc Semideviation
@required {portfolios: [map{portfolioReturns: [num], portfolioValues!: [num]}]}
@optional {minimalAcceptableReturn: num # The constant minimal acceptable return over the considered time period; exclusive with minimalAcceptableReturns, minimalAcceptableReturns: [num] # minimalAcceptableReturns[t] is the minimal acceptable return at the time t; the minimalAcceptableReturns array must have the same length as all the portfolioReturns arrays or the same length minus 1 as all the portfolioValues arrays; exclusive with minimalAcceptableReturn}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/returns/lower-partial-moment
@desc Lower Partial Moment
@required {lowerPartialMomentOrder: num # The order of the lower partial moment, portfolios: [map{portfolioReturns: [num], portfolioValues!: [num]}]}
@optional {minimalAcceptableReturn: num # The constant minimal acceptable return over the considered time period; exclusive with minimalAcceptableReturns, minimalAcceptableReturns: [num] # minimalAcceptableReturns[t] is the minimal acceptable return at the time t; the minimalAcceptableReturns array must have the same length as all the portfolioReturns arrays or the same length minus 1 as all the portfolioValues arrays; exclusive with minimalAcceptableReturn}
@returns(200) {portfolios: [map]} # OK
@example_request {"lowerPartialMomentOrder":2,"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/drawdowns/ulcer-index
@desc Ulcer Index
@required {portfolios: [map{portfolioReturns: [num], portfolioValues: [num]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/drawdowns/pitfall-indicator
@desc Pitfall Indicator
@required {portfolios: [map{portfolioReturns: [num], portfolioValues: [num]}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/drawdowns/conditional/empirical
@desc Empirical Conditional Drawdown
@required {portfolios: [map{portfolioReturns: [num], portfolioValues: [num]}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/drawdowns/maximum
@desc Maximum Drawdown
@required {portfolios: [map{portfolioReturns: [num], portfolioValues: [num]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/drawdowns/average
@desc Average Drawdown
@required {portfolios: [map{portfolioReturns: [num], portfolioValues: [num]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/drawdowns/pain-index
@desc Pain Index
@required {portfolios: [map{portfolioReturns: [num], portfolioValues!: [num]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/drawdowns/ulcer-performance-index
@desc Ulcer Performance Index
@required {portfolios: [map{portfolioReturns: [num], portfolioValues: [num]}]}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage; exclusive with benchmarkReturns, benchmarkReturns: [num] # benchmarkReturns[t] is the arithmetic return of the benchmark at the time t; the benchmarkReturns array must have the same length as all the portfolioReturns arrays or the same length minus 1 as all the portfolioValues arrays; exclusive with riskFreeReturn}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/returns
@desc Arithmetic Returns
@required {portfolios: [map{portfolioValues!: [num]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/returns/logarithmic
@desc Logarithmic Returns
@required {portfolios: [map{portfolioValues!: [num]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/returns/mean
@desc Mean Return
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":2,"assetsMeanReturns":[0.01,0.05],"portfolios":[{"assetsWeights":[1,0]},{"assetsWeights":[0,1]}]}

@endpoint POST /portfolios/analysis/return
@desc Simple Return
@required {portfolios: [map{portfolioValues!: [any]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/return/time-weighted
@desc Time-Weighted Return
@required {portfolios: [map{portfolioValues!: [map], portfolioContributions: [map], portfolioWithdrawals: [map]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[{"date":"2010-01-01","portfolioValue":100},{"date":"2010-04-01","portfolioValue":110},{"date":"2010-07-01","portfolioValue":105},{"date":"2010-08-01","portfolioValue":130},{"date":"2011-01-01","portfolioValue":100}],"portfolioContributions":[{"date":"2010-04-01","contributionAmount":100},{"date":"2010-07-01","contributionAmount":100}],"portfolioWithdrawals":[{"date":"2010-08-01","withdrawalAmount":50}]}]}

@endpoint POST /portfolios/analysis/return/money-weighted
@desc Money-Weighted Return
@required {portfolios: [map{portfolioValues!: [map], portfolioContributions: [map], portfolioWithdrawals: [map]}]}
@optional {moneyWeightedReturnComputationMethod: str(irr/modifiedDietz)=irr # The method to compute the portfolios money-weighted return}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[{"date":"2010-01-01","portfolioValue":100},{"date":"2010-04-01","portfolioValue":110},{"date":"2010-07-01","portfolioValue":105},{"date":"2010-08-01","portfolioValue":130},{"date":"2011-01-01","portfolioValue":100}],"portfolioContributions":[{"date":"2010-04-01","contributionAmount":100},{"date":"2010-07-01","contributionAmount":100}],"portfolioWithdrawals":[{"date":"2010-08-01","withdrawalAmount":50}]}]}

@endpoint POST /portfolios/transformation/time-weighted
@desc Time-Weighted Portfolio
@required {portfolios: [map{portfolioValues!: [map], portfolioContributions: [map], portfolioWithdrawals: [map]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[{"date":"2010-01-01","portfolioValue":100},{"date":"2010-04-01","portfolioValue":110},{"date":"2010-07-01","portfolioValue":105},{"date":"2010-08-01","portfolioValue":130},{"date":"2011-01-01","portfolioValue":100}],"portfolioContributions":[{"date":"2010-04-01","contributionAmount":100},{"date":"2010-07-01","contributionAmount":100}],"portfolioWithdrawals":[{"date":"2010-08-01","withdrawalAmount":50}]}]}

@endpoint POST /portfolios/transformation/money-weighted
@desc Money-Weighted Portfolio
@required {portfolios: [map{portfolioValues!: [map], portfolioContributions: [map], portfolioWithdrawals: [map]}]}
@optional {moneyWeightedReturnComputationMethod: str(irr/modifiedDietz)=irr # The method to compute the portfolios money-weighted return}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[{"date":"2010-01-01","portfolioValue":100},{"date":"2010-04-01","portfolioValue":110},{"date":"2010-07-01","portfolioValue":105},{"date":"2010-08-01","portfolioValue":130},{"date":"2011-01-01","portfolioValue":100}],"portfolioContributions":[{"date":"2010-04-01","contributionAmount":100},{"date":"2010-07-01","contributionAmount":100}],"portfolioWithdrawals":[{"date":"2010-08-01","withdrawalAmount":50}]}]}

@endpoint POST /portfolios/analysis/returns/standard-deviation
@desc Standard Deviation (Volatility)
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"portfolios":[{"assetsWeights":[1,0]},{"assetsWeights":[0,1]}]}

@endpoint POST /portfolios/analysis/returns/variance
@desc Variance
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"portfolios":[{"assetsWeights":[1,0]},{"assetsWeights":[0,1]}]}

@endpoint POST /portfolios/analysis/mean-variance/sharpe-ratio
@desc Sharpe Ratio
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":2,"assetsReturns":[0.01,0.05],"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"portfolios":[{"assetsWeights":[1,0]},{"assetsWeights":[0,1]}]}

@endpoint POST /portfolios/analysis/mean-variance/information-ratio
@desc Information Ratio
@required {benchmarkReturns: [num] # benchmarkReturns[t] is the arithmetic return of the benchmark at the time t; the benchmarkReturns array must have the same length as all the portfolioReturns arrays or the same length minus 1 as all the portfolioValues arrays, portfolios: [map{portfolioReturns: [num], portfolioValues: [num]}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"benchmarkReturns":[100,95,102,105,106,104],"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/mean-variance/sharpe-ratio/confidence-interval
@desc Sharpe Ratio Confidence Interval
@required {portfolios: [map{portfolioValues!: [num]}]}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage, confidenceIntervalType: str(twoSided/lowerOneSided/upperOneSided)=twoSided # The type of confidence interval to build, confidenceLevel: num=0.95 # The confidence level of the confidence interval to build, in percentage}
@returns(200) {portfolios: [map]} # OK
@example_request {"confidenceLevel":0.99,"confidenceIntervalType":"twoSided","portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/mean-variance/sharpe-ratio/probabilistic
@desc Probabilistic Sharpe Ratio
@returns(200) {portfolios: [map]} # OK
@example_request {"benchmarkSharpeRatio":0,"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/diversification-ratio
@desc Diversification Ratio
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"portfolios":[{"assetsWeights":[0.5,0.5]}]}

@endpoint POST /portfolios/analysis/correlation-spectrum
@desc Correlation Spectrum
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"portfolios":[{"assetsWeights":[0.5,0.5]}]}

@endpoint POST /portfolios/analysis/contributions/return
@desc Return Contributions
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, portfolios: [map{assetsWeights!: [num]}]}
@optional {assetsGroups: [[int]]}
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":3,"assetsMeanReturns":[0.01,-0.01,0.025],"assetsGroups":[[1],[2,3]],"portfolios":[{"assetsWeights":[0.5,0.25,0.25]}]}

@endpoint POST /portfolios/analysis/contributions/risk
@desc Risk Contributions
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j, portfolios: [map{assetsWeights!: [num]}]}
@optional {assetsGroups: [[int]]}
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":3,"assetsCovarianceMatrix":[[0.0001,0,0],[0,0.0001,0],[0,0,0.04]],"portfolios":[{"assetsWeights":[0.5,0.25,0.25]}]}

@endpoint POST /portfolios/analysis/contributions/value-at-risk/empirical/multivariate
@desc Multivariate Empirical Value at Risk Contributions
@required {assets: [any], portfolios: [map{assetsWeights!: [num]}]}
@optional {confidenceLevel: num=0.95 # The confidence level, empiricalQuantileEstimationMethod: str(linearInterpolationQuantileEstimation/harrellDavisQuantileEstimation)=linearInterpolationQuantileEstimation # The empirical quantile estimation method to use, assetsGroups: [[int]]}
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,0.02]}],"portfolios":[{"assetsWeights":[0.5,0.5]}]}

@endpoint POST /portfolios/analysis/contributions/value-at-risk/parametric/gaussian/multivariate
@desc Multivariate Gaussian Value at Risk Contributions
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,0.02]}],"portfolios":[{"assetsWeights":[0.5,0.5]}]}

@endpoint POST /portfolios/analysis/contributions/value-at-risk/parametric/gaussian/mixture/multivariate
@desc Multivariate Gaussian Mixture Value at Risk Contributions
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03,0.015]},{"assetReturns":[0.01,0,0.02,0.02,0.015]}],"portfolios":[{"assetsWeights":[0.5,0.5]}]}

@endpoint POST /portfolios/analysis/contributions/diversification-ratio
@desc Diversification Ratio Contributions
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j, portfolios: [map{assetsWeights!: [num]}]}
@optional {assetsGroups: [[int]]}
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":3,"assetsCovarianceMatrix":[[0.0001,0,0],[0,0.0001,0],[0,0,0.04]],"portfolios":[{"assetsWeights":[0.5,0.25,0.25]}]}

@endpoint POST /portfolios/analysis/contributions/sharpe-ratio
@desc Sharpe Ratio Contributions
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j, portfolios: [map{assetsWeights!: [num]}]}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage, assetsGroups: [[int]]}
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":3,"assetsMeanReturns":[0.01,-0.01,0.025],"assetsCovarianceMatrix":[[0.0001,0,0],[0,0.0001,0],[0,0,0.04]],"portfolios":[{"assetsWeights":[0.5,0.25,0.25]}]}

@endpoint POST /portfolios/optimization/equal-weighted
@desc Equal Weighted Portfolio
@required {assets: int # The number of assets}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2}

@endpoint POST /portfolios/optimization/inverse-variance-weighted
@desc Inverse Variance Weighted Portfolio
@required {assets: int # The number of assets, assetsVariances: [num] # assetsVariances[i] is the variance of the asset i}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsVariances":[1,0.5]}

@endpoint POST /portfolios/optimization/inverse-volatility-weighted
@desc Inverse Volatility Weighted Portfolio
@required {assets: int # The number of assets, assetsVolatilities: [num] # assetsVolatilities[i] is the volatility of the asset i}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsVolatilities":[0.05,0.1]}

@endpoint POST /portfolios/optimization/equal-volatility-weighted
@desc Equal Volatility Weighted Portfolio
@required {assets: int # The number of assets, assetsVolatilities: [num] # assetsVolatilities[i] is the volatility of the asset i}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsVolatilities":[0.05,0.1]}

@endpoint POST /portfolios/optimization/equal-risk-contributions
@desc Equal Risk Contributions Portfolio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j}
@optional {constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num]}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"constraints":{"maximumAssetsWeights":[0.4,1]}}

@endpoint POST /portfolios/optimization/equal-risk-contributions/clustering-based
@desc Clustering-based Equal Risk Contributions Portfolio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j, assetsGroups: [[int]]}
@optional {constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num]}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":3,"assetsCovarianceMatrix":[[0.05,0.02,0],[0.02,0.07,0.5],[0,0.5,0.1]],"assetsGroups":[[1,2],[3]]}

@endpoint POST /portfolios/optimization/supervised/nearest-neighbors-based
@desc k-Nearest Neighbors Supervised Portfolio
@required {assets: int # The number of assets, assetsTrainingSample: [map{assetsFeatures!: [num], assetsWeights!: [num]}] # assetsTrainingSample[i] is the i-th training data point for the k-nearest neighbors regression algorithm, assetsInferenceSample: [map{assetsFeatures!: [num]}] # assetsInferenceSample[i] is the i-th inference data point for the k-nearest neighbors regression algorithm}
@optional {nearestNeighborsForecastMethod: str(kMean/kStar/kEnsemble)=kStar # The forecast method used to determine the label of an inference point, nearestNeighbors: int=1 # The number of nearest neighbors used to determine the label of an inference point when nearestNeighborsForecastMethod is equal to 'kMean', nearestNeighborsDistanceMetric: str(euclidean/hassanat)=hassanat # The distance metric used to compute the nearest neighbors of an inference point}
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":2,"assetsTrainingSample":[{"assetsFeatures":[0.29,0.62,0.000012038196929181625,0.0000696814929855677,0.00001559563475910431],"assetsWeights":[0,0]},{"assetsFeatures":[-0.46,0.45,0.000010888657978348465,0.00006302859758217985,0.000013796702980234435],"assetsWeights":[0,0.9180311027016663]},{"assetsFeatures":[0.29,0.62,0.000009870728035855486,0.000056657515212347,0.000012695407664899547],"assetsWeights":[0,0.7845192140292089]}],"assetsInferenceSample":[{"assetsFeatures":[0.29,0.62,0.000041282848226584026,0.000042737618434521984,0.000017469438409288166]}],"nearestNeighborsForecastMethod":"kEnsemble"}

@endpoint POST /portfolios/optimization/risk-budgeting
@desc Risk Budgeting Portfolio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j, assetsRiskBudgets: [num] # assetsRiskBudgets[i] is the risk budget allocated to the asset i, in percentage; the sum of all the assetsRiskBudgets must be equal to 1}
@optional {constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num]}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"assetsRiskBudgets":[0.4,0.6]}

@endpoint POST /portfolios/optimization/maximum-decorrelation
@desc Maximum Decorrelation Portfolio
@required {assets: int # The number of assets, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j}
@optional {constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.9,0.85],[0.9,1,0.7],[0.85,0.7,1]]}

@endpoint POST /portfolios/optimization/minimum-correlation
@desc Minimum Correlation Portfolio
@required {assets: int, assetsCorrelationMatrix: [[num]] # assetsCorrelationMatrix[i][j] is the correlation between the asset i and the asset j, assetsVolatilities: [num] # assetsVolatilities[i] is the volatility of the asset i}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":3,"assetsCorrelationMatrix":[[1,0.9,0.85],[0.9,1,0.7],[0.85,0.7,1]],"assetsVolatilities":[0.14,0.18,0.22]}

@endpoint POST /portfolios/optimization/most-diversified
@desc Most Diversified Portfolio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j}
@optional {constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.04,0.01],[0.01,0.01]]}

@endpoint POST /portfolios/optimization/minimum-variance
@desc Minimum Variance Portfolio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"constraints":{"maximumAssetsWeights":[0.4,1],"minimumPortfolioExposure":0.25,"maximumPortfolioExposure":0.5}}

@endpoint POST /portfolios/optimization/minimum-variance/diversified
@desc Diversified Minimum Variance Portfolio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, portfolioMeanReturnTolerance: num=0.1 # The relative tolerance over the minimum variance portfolio mean return, if applicable, portfolioVolatilityTolerance: num=0.1 # The relative tolerance over the minimum variance portfolio volatility, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"constraints":{"maximumAssetsWeights":[0.4,1],"minimumPortfolioExposure":0.5,"maximumPortfolioExposure":0.5}}

@endpoint POST /portfolios/optimization/minimum-variance/resampling-based
@desc Resampling-Based Minimum Variance Portfolio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, simulatedPortfolios: int=128 # The number of portfolios to simulate, simulatedPortfoliosAggregationMethod: str(average/median)=average # The method to aggregate the simulated portfolios, assetsMeanReturnsUncertaintyIntervals: [[num]], assetsStandardDeviationsUncertaintyIntervals: [[num]], assetsCorrelationMatrixUncertaintyLevel: num # The uncertainty level on the coefficients of the asset correlation matrix associated to assetsCovarianceMatrix; defaults to 0.10, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"assetsCorrelationMatrixUncertaintyLevel":0.25}

@endpoint POST /portfolios/optimization/minimum-variance/subset-resampling-based
@desc Subset Resampling-Based Minimum Variance Portfolio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, subsetSize: int # The number of assets to include in each subset portfolio; defaults to a value of order the square root of the total number of assets, simulatedPortfolios: int=128 # The number of simulated portfolios to compute; only applicable if the generation method for the subset portfolios is random sampling, simulatedPortfoliosGenerationMethod: str(complete/random)=random # The method to generate the simulated portfolios, simulatedPortfoliosAggregationMethod: str(average/median)=average # The method to aggregate the simulated portfolios, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"simulatedPortfolios":1,"constraints":{"maximumAssetsWeights":[0.4,1],"minimumPortfolioExposure":0.5,"maximumPortfolioExposure":0.5}}

@endpoint POST /portfolios/optimization/hierarchical-risk-parity
@desc Hierarchical Risk Parity Portfolio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j}
@optional {clusteringMethod: str(singleLinkage/averageLinkage/completeLinkage/wardLinkage)=singleLinkage # The hierarchical clustering method to use, clusteringOrdering: str(r-hclust/optimal)=r-hclust # The order to impose on the hierarchical clustering tree leaves, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"constraints":{"maximumAssetsWeights":[0.4,1],"minimumPortfolioExposure":0.5,"maximumPortfolioExposure":0.5}}

@endpoint POST /portfolios/optimization/hierarchical-risk-parity/clustering-based
@desc Hierarchical Clustering-Based Risk Parity Portfolio
@required {assets: int # The number of assets, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j}
@optional {clusteringMethod: str(singleLinkage/averageLinkage/completeLinkage/wardLinkage)=wardLinkage # The hierarchical clustering method to use, clusteringOrdering: str(r-hclust/optimal)=r-hclust # The order to impose on the hierarchical clustering tree leaves, clusters: int # The number of clusters to use in the hierarchical clustering tree; if not provided, the number of clusters to use is computed using the gap statistic method, as described in the first reference, acrossClusterAllocationMethod: str(equalWeighting/inverseVolatility/inverseVariance)=equalWeighting # The allocation method to use across clusters, withinClusterAllocationMethod: str(equalWeighting/inverseVolatility/inverseVariance)=equalWeighting # The allocation method to use within clusters, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0025,0.0005],[0.0005,0.01]],"constraints":{"maximumAssetsWeights":[0.4,1],"minimumPortfolioExposure":0.5,"maximumPortfolioExposure":0.5}}

@endpoint POST /portfolios/optimization/maximum-return
@desc Maximum Return Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i}
@optional {assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsMeanReturns":[0.02,0.01],"constraints":{"maximumAssetsWeights":[0.4,1]}}

@endpoint POST /portfolios/optimization/maximum-return/diversified
@desc Diversified Maximum Return Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i}
@optional {assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns, portfolioMeanReturnTolerance: num=0.1 # The relative tolerance over the maximum return portfolio mean return, if applicable, portfolioVolatilityTolerance: num=0.1 # The relative tolerance over the maximum return portfolio volatility, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsMeanReturns":[0.02,0.01],"constraints":{"maximumAssetsWeights":[0.4,1]}}

@endpoint POST /portfolios/optimization/maximum-return/resampling-based
@desc Resampling-Based Maximum Return Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i}
@optional {assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns, simulatedPortfolios: int=128 # The number of portfolios to simulate, simulatedPortfoliosAggregationMethod: str(average/median)=average # The method to aggregate the simulated portfolios, assetsMeanReturnsUncertaintyIntervals: [[num]], assetsStandardDeviationsUncertaintyIntervals: [[num]], assetsCorrelationMatrixUncertaintyLevel: num # The uncertainty level on the coefficients of the asset correlation matrix associated to assetsCovarianceMatrix, if applicable; defaults to 0, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":3,"assetsMeanReturns":[0.01,0.02,0.03],"assetsMeanReturnsUncertaintyIntervals":[[0.009,0.011],[0.02,0.02],[0.027,0.033]]}

@endpoint POST /portfolios/optimization/maximum-return/subset-resampling-based
@desc Subset Resampling-Based Maximum Return Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i}
@optional {assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns, subsetSize: int # The number of assets to include in each subset portfolio; defaults to a value of order the square root of the total number of assets, simulatedPortfolios: int=128 # The number of simulated portfolios to compute; only applicable if the generation method for the subset portfolios is random sampling, simulatedPortfoliosGenerationMethod: str(complete/random)=random # The method to generate the simulated portfolios, simulatedPortfoliosAggregationMethod: str(average/median)=average # The method to aggregate the simulated portfolios, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":3,"assetsMeanReturns":[0.01,0.02,0.03],"simulatedPortfoliosGenerationMethod":"complete"}

@endpoint POST /portfolios/optimization/maximum-sharpe-ratio
@desc Maximum Sharpe Ratio Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsMeanReturns":[0.05,0.1],"assetsCovarianceMatrix":[[0.05,0.02],[0.02,0.07]]}

@endpoint POST /portfolios/optimization/maximum-sharpe-ratio/diversified
@desc Diversified Maximum Sharpe Ratio Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage, portfolioMeanReturnTolerance: num=0.1 # The relative tolerance over the maximum Sharpe Ratio portfolio return, if applicable, portfolioVolatilityTolerance: num=0.1 # The relative tolerance over the maximum Sharpe Ratio portfolio volatility, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsMeanReturns":[0.05,0.1],"assetsCovarianceMatrix":[[0.05,0.02],[0.02,0.07]]}

@endpoint POST /portfolios/optimization/maximum-sharpe-ratio/resampling-based
@desc Resampling-Based Maximum Sharpe Ratio Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage, simulatedPortfolios: int=128 # The number of portfolios to simulate, simulatedPortfoliosAggregationMethod: str(average/median)=average # The method to aggregate the simulated portfolios, assetsMeanReturnsUncertaintyIntervals: [[num]], assetsStandardDeviationsUncertaintyIntervals: [[num]], assetsCorrelationMatrixUncertaintyLevel: num # The uncertainty level on the coefficients of the asset correlation matrix associated to assetsCovarianceMatrix; defaults to 0.10, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":3,"assetsMeanReturns":[0.01,0.02,0.03],"assetsMeanReturnsUncertaintyIntervals":[[0.009,0.011],[0.02,0.02],[0.027,0.033]],"assetsCovarianceMatrix":[[0.0146,0.0187,0.0145],[0.0187,0.0854,0.0104],[0.0145,0.0104,0.0289]]}

@endpoint POST /portfolios/optimization/maximum-sharpe-ratio/subset-resampling-based
@desc Subset Resampling-Based Maximum Sharpe Ratio Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage, subsetSize: int # The number of assets to include in each subset portfolio; defaults to a value of order the square root of the total number of assets, simulatedPortfolios: int=128 # The number of simulated portfolios to compute; only applicable if the generation method for the subset portfolios is random sampling, simulatedPortfoliosGenerationMethod: str(complete/random)=random # The method to generate the simulated portfolios, simulatedPortfoliosAggregationMethod: str(average/median)=average # The method to aggregate the simulated portfolios, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":3,"assetsMeanReturns":[0.05,0.1,0.025],"assetsCovarianceMatrix":[[0.0146,0.0187,0.0145],[0.0187,0.0854,0.0104],[0.0145,0.0104,0.0289]]}

@endpoint POST /portfolios/optimization/mean-variance-efficient
@desc Mean-Variance Efficient Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns, constraints: map{portfolioMeanReturn: num, portfolioVolatility: num, maximumPortfolioVolatility: num, riskTolerance: num, minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsMeanReturns":[0.1,0.2],"assetsCovarianceMatrix":[[1,0.3],[0.3,1]],"constraints":{"portfolioMeanReturn":0.15}}

@endpoint POST /portfolios/optimization/mean-variance-efficient/diversified
@desc Diversified Mean-Variance Efficient Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns, constraints: map{portfolioMeanReturn: num, portfolioVolatility: num, riskTolerance: num, minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@optional {portfolioMeanReturnTolerance: num=0.1 # The relative tolerance over the mean-variance efficient portfolio return, if applicable, portfolioVolatilityTolerance: num=0.1 # The relative tolerance over the mean-variance efficient portfolio volatility}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsMeanReturns":[0.1,0.2],"assetsCovarianceMatrix":[[1,0.3],[0.3,1]],"portfolioMeanReturnTolerance":0.05,"portfolioVolatilityTolerance":0.05,"constraints":{"portfolioMeanReturn":0.175}}

@endpoint POST /portfolios/optimization/mean-variance-efficient/resampling-based
@desc Resampling-Based Mean-Variance Efficient Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns}
@optional {simulatedPortfolios: int=128 # The number of portfolios to simulate, simulatedPortfoliosAggregationMethod: str(average/median)=average # The method to aggregate the simulated portfolios, assetsMeanReturnsUncertaintyIntervals: [[num]], assetsStandardDeviationsUncertaintyIntervals: [[num]], assetsCorrelationMatrixUncertaintyLevel: num # The uncertainty level on the coefficients of the asset correlation matrix associated to assetsCovarianceMatrix; defaults to 0.10, constraints: map{portfolioMeanReturn: num, portfolioVolatility: num, maximumPortfolioVolatility: num, riskTolerance: num, minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":3,"assetsMeanReturns":[0.1,0.2,0.15],"assetsCovarianceMatrix":[[1,0.3,-0.2],[0.3,1,0.2],[-0.2,0.2,1]],"assetsMeanReturnsUncertaintyIntervals":[[0.09,0.11],[0.2,0.2],[0.15,0.15]],"assetsStandardDeviationsUncertaintyIntervals":[[0.5,1.5],[0.5,1.5],[0.5,1.5]],"constraints":{"portfolioMeanReturn":0.15}}

@endpoint POST /portfolios/optimization/mean-variance-efficient/subset-resampling-based
@desc Subset Resampling-Based Mean-Variance Efficient Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j arithmetic returns, constraints: map{portfolioMeanReturn: num, portfolioVolatility: num, riskTolerance: num, minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@optional {subsetSize: int # The number of assets to include in each subset portfolio; defaults to a value of order the square root of the total number of assets, simulatedPortfolios: int=128 # The number of simulated portfolios to compute; only applicable if the generation method for the subset portfolios is random sampling, simulatedPortfoliosGenerationMethod: str(complete/random)=random # The method to generate the simulated portfolios, simulatedPortfoliosAggregationMethod: str(average/median)=average # The method to aggregate the simulated portfolios}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":3,"assetsMeanReturns":[0.1,0.2,0.3],"assetsCovarianceMatrix":[[1,0,0],[0,1,0],[0,0,1]],"constraints":{"riskTolerance":2}}

@endpoint POST /portfolios/optimization/equal-sharpe-ratio-contributions
@desc Equal Sharpe Ratio Contributions Portfolio
@required {assets: int # The number of assets, assetsMeanReturns: [num] # assetsMeanReturns[i] is the arithmetic (expected) return of asset i, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsMeanReturns":[0.05,0.1],"assetsCovarianceMatrix":[[0.05,0.02],[0.02,0.07]]}

@endpoint POST /portfolios/optimization/market-capitalization-weighted
@desc Market Capitalization Weighted Portfolio
@required {assets: int # The number of assets, assetsMarketCapitalizations: [num] # assetsMarketCapitalizations[i] is the market capitalization of the asset i}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":2,"assetsMarketCapitalizations":[1,2]}

@endpoint POST /portfolios/optimization/maximum-ulcer-performance-index
@desc Maximum Ulcer Performance Index Portfolio
@required {assets: [map{assetPrices!: [num]}]}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage, constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":[{"assetPrices":[100,95,110]},{"assetPrices":[100,105,100]}]}

@endpoint POST /portfolios/optimization/minimum-ulcer-index
@desc Minimum Ulcer Index Portfolio
@required {assets: [map{assetPrices!: [num]}]}
@optional {constraints: map{minimumAssetsWeights: [num], maximumAssetsWeights: [num], assetsGroups: [[int]], assetsGroupsMatrix: [[num]], maximumAssetsGroupsWeights: [num], minimumPortfolioExposure: num, maximumPortfolioExposure: num}}
@returns(200) {assetsWeights: [num]} # OK
@example_request {"assets":[{"assetPrices":[100,95,110]},{"assetPrices":[100,105,100]}]}

@endpoint POST /portfolios/analysis/value-at-risk/estimation/empirical
@desc Empirical Value At Risk
@required {portfolios: [map{portfolioValues!: [num]}]}
@optional {confidenceLevel: num=0.95 # The confidence level, empiricalQuantileEstimationMethod: str(linearInterpolationQuantileEstimation/hutsonQuantileEstimation/harrellDavisQuantileEstimation)=linearInterpolationQuantileEstimation # The empirical quantile estimation method to use}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/estimation/empirical/multivariate
@desc Multivariate Empirical Value At Risk
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,0.02]}],"portfolios":[{"assetsWeights":[1,0]},{"assetsWeights":[0,1]}]}

@endpoint POST /portfolios/analysis/value-at-risk/estimation/extreme-value-theory-based
@desc Extreme Value Theory-Based Value At Risk
@required {portfolios: [map{portfolioValues!: [num]}]}
@optional {confidenceLevel: num=0.95 # The confidence level, evtQuantileEstimationMethod: str(gpdQuantileEstimation/weissmanHeavyTailedQuantileEstimation)=gpdQuantileEstimation # The extreme value theory-based quantile estimation method to use}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/estimation/parametric/gaussian
@desc Gaussian Value At Risk
@required {portfolios: [any]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/estimation/parametric/gaussian/multivariate
@desc Multivariate Gaussian Value At Risk
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02,0.02]}],"portfolios":[{"assetsWeights":[0.5,0.5]}]}

@endpoint POST /portfolios/analysis/value-at-risk/estimation/parametric/student
@desc Student-t Value At Risk
@required {portfolios: [any]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/estimation/parametric/cornish-fisher
@desc Cornish-Fisher Value At Risk
@required {portfolios: [any]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/estimation/parametric/cornish-fisher/corrected
@desc Corrected Cornish-Fisher Value At Risk
@required {portfolios: [any]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/estimation/parametric/gaussian/mixture
@desc Gaussian Mixture Value At Risk
@required {portfolios: [any]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/estimation/parametric/gaussian/mixture/multivariate
@desc Multivariate Gaussian Mixture Value At Risk
@returns(200) {portfolios: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03,0.015]},{"assetReturns":[0.01,0,0.02,0.02,0.001]}],"portfolios":[{"assetsWeights":[0.5,0.5]}]}

@endpoint POST /portfolios/analysis/value-at-risk/forecast/arma-garch
@desc Generalized AutoRegressive Conditional Heteroscedasticity (GARCH(1,1)) Value At Risk
@required {portfolios: [map{portfolioValues!: [num], portfolioReturnsConditionalMeanModel: str, portfolioReturnsStandardizedResidualsDistribution: str}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/forecast/arma-ewma
@desc Exponentially Weighted Moving Average (EWMA) Value At Risk
@required {portfolios: [map{portfolioValues!: [num], portfolioReturnsConditionalMeanModel: str, portfolioReturnsStandardizedResidualsDistribution: str}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/conditional/forecast/arma-garch
@desc Generalized AutoRegressive Conditional Heteroscedasticity (GARCH(1,1)) Conditional Value At Risk
@required {portfolios: [map{portfolioValues!: [num], portfolioReturnsConditionalMeanModel: str, portfolioReturnsStandardizedResidualsDistribution: str}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/conditional/forecast/arma-ewma
@desc Exponentially Weighted Moving Average (EWMA) Conditional Value At Risk
@required {portfolios: [map{portfolioValues!: [num], portfolioReturnsConditionalMeanModel: str, portfolioReturnsStandardizedResidualsDistribution: str}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/conditional/estimation/empirical
@desc Empirical Conditional Value At Risk
@required {portfolios: [map{portfolioValues!: [num]}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/conditional/estimation/parametric/gaussian
@desc Gaussian Conditional Value At Risk
@required {portfolios: [map{portfolioValues!: [num]}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/conditional/estimation/parametric/student
@desc Student-t Conditional Value At Risk
@required {portfolios: [map{portfolioValues!: [num]}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/conditional/estimation/parametric/cornish-fisher
@desc Cornish-Fisher Conditional Value At Risk
@required {portfolios: [map{portfolioValues!: [num]}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/conditional/estimation/parametric/cornish-fisher/corrected
@desc Corrected Cornish-Fisher Conditional Value At Risk
@required {portfolios: [map{portfolioValues!: [num]}]}
@optional {confidenceLevel: num=0.95 # The confidence level}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endpoint POST /portfolios/analysis/value-at-risk/conditional/estimation/parametric/gaussian/mixture
@desc Gaussian Mixture Conditional Value At Risk
@required {portfolios: [map{portfolioValues!: [num], confidenceLevel: num}]}
@returns(200) {portfolios: [map]} # OK
@example_request {"portfolios":[{"portfolioValues":[100,95,100,90,85,70]}]}

@endgroup

@group assets
@endpoint POST /assets/returns/transformation/moment-matched
@desc Moment-matched Returns
@required {assets: [map{assetReturns!: [num]}]}
@optional {targetMeans: [num] # targetMeans[i] is the target mean return of the asset i, targetCovarianceMatrix: [[num]] # targetCovarianceMatrix[i][j] is the target covariance between the asset i and the asset j}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]}],"targetMeans":[0],"targetCovarianceMatrix":[[0.1]]}

@endpoint POST /assets/returns/transformation/unsmoothed
@desc Unsmoothed Returns
@required {assets: [map{assetReturns!: [num]}]}
@optional {unsmoothingMethod: str(geltner/okunevWhite)=geltner # The unsmoothing method to use, unsmoothingMethodOrder: int=1 # The order of autocorrelation to be removed from the asset returns; if unsmoothingMethod is equal to "geltner", the maximum allowed value is 1}
@returns(200) {assets: [map]} # OK
@example_request {"assets":[{"assetReturns":[0.001,0.00205121,0.00315633,0.00677923,0.01868891,0.01389516]}]}

@endpoint POST /assets/returns/expected/estimation/empirical
@desc Empirical Expected Returns
@returns(200) {assetsMeanReturns: [num]} # OK
@example_request {"assets":[{"assetReturns":[0.01,0,0.02,-0.03]},{"assetReturns":[0.01,0,0.02]}]}

@endpoint POST /assets/returns/expected/estimation/implied
@desc Implied Expected Returns
@required {assets: int # The number of assets in the portfolio, assetsCovarianceMatrix: [[num]] # assetsCovarianceMatrix[i][j] is the covariance between the asset i and the asset j, assetsWeights: [num] # assetsWeights[i] is the weight of the asset i in the portfolio, in percentage, constraints: map{riskTolerance: num, portfolioMeanReturn: num, portfolioSharpeRatio: num, assetsExpectedReturns: [num], portfolioHistoricalReturns: [num], riskFreeHistoricalReturns: [num], riskFreeHistoricalReturn: num}}
@optional {riskFreeReturn: num=0 # The constant risk-free arithmetic return over the considered time period, in percentage}
@returns(200) {assetsMeanReturns: [num]} # OK
@example_request {"assets":2,"assetsCovarianceMatrix":[[0.0225,0.0012],[0.0012,0.0016]],"assetsWeights":[0.1139,0.8861],"constraints":{"riskTolerance":9.65}}

@endpoint POST /assets/returns/expected/estimation/ordering-information-based
@desc Expected Returns from Ordering Information
@required {assets: int # The number of assets, assetsOrderingBeliefsMatrix: [[num]] # assetsOrderingBeliefsMatrix[i] is the i-th belief vector on assets' expected returns}
@optional {assetsExpectedReturnsScalingFactor: num=1 # The typical scale of asset expected returns magnitude, in percent (e.g. 0.05 if asset expected returns are yearly asset returns with a typical magnitude of 5% per year)}
@returns(200) {assetsMeanReturns: [num]} # OK
@example_request {"assets":3,"assetsOrderingBeliefsMatrix":[[1,-1,0],[0,1,-1]]}

@endgroup

@end
