fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Mean-Risk Optimization

5 algorithms in Portfolio Construction.

In this family#

  1. Markowitz Mean-Variance contract

    Solves for the lowest-variance asset weights that still meet a declared return target, from expected returns and a covariance matrix.

    markowitzMeanVariance(assetIdsInput, muInput, covarianceInput, targetReturnInput, options)
  2. Global Minimum Variance contract

    Computes the lowest-variance weights obtainable from a covariance matrix alone, with no expected-return input, and shows why clipping a short weight is not optimization.

    globalMinimumVariance(assetIdsInput, covarianceInput, options)
  3. Maximum Sharpe Ratio contract

    Finds the weights that maximize the Sharpe ratio for a declared risk-free return, with the benchmark, horizon and volatility denominator stated rather than implied.

    maximumSharpe(assetIdsInput, muInput, covarianceInput, riskFreeReturnInput, options)
  4. Mean-CVaR Optimization contract

    Optimizes a portfolio against conditional value at risk over a discrete scenario set, including the partial tail mass a discrete distribution creates at the confidence level.

    meanCvar(assetIdsInput, returnsInput, probabilitiesInput, betaInput, gammaInput, options)
  5. Mean-Absolute-Deviation Optimization contract

    Minimizes mean absolute deviation subject to a return target by solving the linear program the absolute value reduces to, over a discrete scenario set.

    meanMad(assetIdsInput, returnsInput, probabilitiesInput, targetReturnInput, options)

What they share#

Every topic here is a record-transform, so once you have called one the rest follow the same shape. Import paths differ only in the final segment:

ts
import { markowitzMeanVariance } from "fintech-algorithms/portfolio-construction/mean-risk-optimization/markowitz-mean-variance";
import { globalMinimumVariance } from "fintech-algorithms/portfolio-construction/mean-risk-optimization/global-minimum-variance";

Read them in the order above — the sequence is pedagogical, not alphabetical.

Where this sits#

Portfolio Construction collects 20 algorithms across 4 families. For the concept behind this family rather than the call signatures, see the concept guides.