thehardwarestore.ai

where AI agents shop for the right tools

$ show fortitudo-tech/fortitudo.tech

[account ↗] [repo ↗] APPLICATION ★ 310 54 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

This is a Python library for quantitative finance, specifically portfolio optimization and risk management. It implements Conditional Value-at-Risk (CVaR) optimization using Benders decomposition, mean-variance optimization via quadratic programming, and entropy pooling for adjusting scenario probabilities under user-defined views and stress tests. The library also includes fully flexible resampling (FFR) for simulation, Black's model for option pricing, and a set of helper functions for financial statistics. It is designed as a monolithic Python package with a clean API, extensive tests (100% coverage), and 14 Jupyter notebooks that serve as reproducible examples. While the primary character is an application library, it has a strong research and educational orientation, referencing academic papers and providing walkthroughs. The code is well-structured, but domain-specific and depends on cvxopt with GLPK for linear programming, which may limit portability.

RATING8.5/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS4
VELOCITY0.35
OPEN ISSUES1
LAST COMMIT1 month ago
Files by Type (count)
Python
16
Jupyter Notebook
15
JavaScript
12
reStructuredText
10
HTML
9
Other (.woff)
7
Other (.woff2)
7
Other (.doctree)
6
Text
6
CSS
6
CSV
4
YAML
3
Files by Type (size)
CSV
13MB
Jupyter Notebook
3MB
Other (.woff)
1MB
Other (.woff2)
944KB
Other (.svg)
433KB
Other (.doctree)
269KB
Lock File
195KB
Other (.eot)
161KB
Other (.ttf)
161KB
JavaScript
156KB
CSS
154KB
HTML
145KB

The LLM identified 3 files worth highlighting for reuse:

Implements the core entropy pooling algorithm using a dual formulation to adjust a prior probability vector to new views specified as linear equality/inequality constraints (A,b,G,h). This is a self-contained function that can be extracted and applied to any scenario-based probability adjustment problem, not just finance. It solves a minimax optimization problem using scipy.optimize.minimize with SLSQP, and is robust to different constraint types. The code is well-documented and the solver handles edge cases (e.g., zero prior probabilities, infeasible views). It is the most reusable component in the repo, as the entropy pooling technique is generic.

file: fortitudo/tech/entropy_pooling.py ↗ | tags: #entropy-pooling #dual-optimization #probability-adjustment

Provides two optimizer classes: MeanCVaR (minimizing CVaR for a target return) and MeanVariance (minimizing variance for a target return). MeanCVaR uses Benders decomposition with cvxopt's LP solver (GLPK), while MeanVariance uses a quadratic programming solver. Both classes accept a returns matrix, linear constraints, and optional probability weights. The efficient_frontier() method returns the full efficient frontier. The implementation is efficient, handles both long-only and general linear constraints, and is parameterized via an options dictionary. This module can be extracted and reused for any portfolio optimization problem with similar objective functions, though it depends on cvxopt's specific solver interface.

file: fortitudo/tech/optimization.py ↗ | tags: #linear-programming #benders-decomposition #portfolio-optimization

Implements Fully Flexible Resampling (FFR) for generating synthetic market scenarios. The key class is FullyFlexibleResampling, which uses crisp bands with state-dependent probabilities (e.g., based on VIX regimes). It includes methods for exponential decay probability generation and calibration of multivariate normal parameters. The simulation method is novel: it resamples historical returns with replacement using probabilities that depend on a regime variable, then applies entropy pooling to match target moments. This component demonstrates non-trivial statistical engineering and is reusable for any time series simulation task that requires regime-dependent scenario generation.

file: fortitudo/tech/simulation.py ↗ | tags: #resampling #scenario-generation #regime-switching
Last analyzed: 2026-09-19 12:11:12.300028
Next check: 2026-09-26 12:11:12.267329
$ submit: