How MAISNER Works
A technical reference for the mathematical models underlying the platform. Written for quantitative professionals, portfolio managers, and technically minded investors.
Portfolio Optimization — Mean-Variance
MAISNER implements Markowitz Mean-Variance Optimization (MVO) with several institutional-grade enhancements. The core problem maximizes the Sharpe ratio subject to linear constraints.
Objective Function
Constraints
Three portfolios are computed simultaneously: Max Sharpe, Minimum Variance, and Equal Weight. This allows direct comparison of optimization strategies against a naive benchmark.
| Parameter | Value | Description |
|---|---|---|
| RISK_FREE | 3.80% | Risk-free rate (ECB rate proxy) |
| WEIGHT_MAX | 35% | Maximum weight per asset |
| FREQ | 252 / 12 | Daily if ≥400 obs, else monthly |
Constrained Optimization
The Constrained Optimizer allows portfolio managers to impose explicit structural requirements on individual positions and sectors, then optimizes the remaining free budget using the same RMT-MVO engine. This is the institutional standard for managing client mandates, regulatory constraints, and conviction-driven overrides.
Asset Partition
All assets in the portfolio are classified into one of three sets before optimization begins.
𝓑 = bounded set (per-ticker bounds: lbi ≤ wi ≤ ubi)
𝓕 = free set (standard bounds: 0 ≤ wi ≤ wmax)
Remaining Budget
Full Optimization Problem
Constraint Types
| Type | Syntax | Description |
|---|---|---|
| Locked weight | wi = c | Position fixed at exact percentage. Optimizer cannot move it. |
| Locked shares | ni = k | Fixed number of shares. Weight derived from current market price. |
| Min/max per ticker | lbi ≤ wi ≤ ubi | Optimizer chooses within the specified range. |
| Sector floor | Σsector ≥ smin | Forces minimum allocation to a sector. |
| Sector ceiling | Σsector ≤ smax | Caps total allocation to a sector (default 40%). |
Infeasibility Handling
If the set of constraints is infeasible (e.g. locked weights sum to more than 1, or sector caps conflict with locked positions), MAISNER raises an explicit error identifying which constraint is violated. It never silently relaxes user-defined constraints.
Random Matrix Theory — Covariance Cleaning
Raw sample covariance matrices are notoriously noisy for typical portfolio sizes. MAISNER applies Marchenko-Pastur filtering to separate signal eigenvalues from noise eigenvalues.
Marchenko-Pastur Distribution
The ratio Q = T/N determines the noise floor. For small portfolios with limited history, RMT cleaning provides substantial improvement in out-of-sample covariance estimates. The cleaned matrix retains the information eigenvalues (genuine risk factors) while suppressing estimation error.
Quality Tilt
Pure Sharpe maximization often overweights assets with recent momentum. MAISNER applies a quality penalty to the MVO objective, tilting the optimizer toward fundamentally strong companies.
Quality Score
Quality scores are computed from FMP fundamental data: ROE, gross margin, operating margin, and debt coverage ratio. Each metric is normalized and combined into a composite score in [0, 1].
| Parameter | Value |
|---|---|
| LAMBDA_QUAL | 0.05 |
| QUALITY_THRESH | 0.30 |
| Metrics | ROE, Gross Margin, Op. Margin, Debt Coverage |
CVaR Optimization
For multi-asset portfolios including options and non-linear instruments, mean-variance optimization is inappropriate. MAISNER uses Conditional Value-at-Risk (CVaR) minimization via linear programming.
CVaR Definition
Correlated Scenario Generation
| Parameter | Value |
|---|---|
| Scenarios | 5,000 |
| Alpha | 0.95 |
| Method | LP (linear programming) |
| Correlation | Cholesky on RMT-cleaned Σ |
Monte Carlo Simulation
Long-horizon wealth projections are generated via Geometric Brownian Motion with correlated asset paths.
| Parameter | Value |
|---|---|
| Paths | 10,000 |
| Horizon | 10 years |
| Output | 5th / 50th / 95th percentile |
| Metrics | P(loss), P(2×), Median@10y, Range |
Stress Testing
Historical scenario analysis replays actual crisis return distributions against the current and optimised portfolios. Custom stress mode allows arbitrary macro shock specification.
Historical Scenarios
| Scenario | Period | S&P 500 Drawdown |
|---|---|---|
| 2008 GFC | Sep 2008 – Mar 2009 | −56.8% |
| 2020 COVID | Feb 2020 – Mar 2020 | −33.9% |
| 2022 Rate Shock | Jan 2022 – Oct 2022 | −25.4% |
| 2000 Dot-com | Mar 2000 – Oct 2002 | −49.1% |
Advanced Stress — Custom Shocks
Users can define simultaneous shocks across equity markets (by region/sector), interest rates, FX rates, and individual ticker overrides. Shocks are applied as multiplicative return adjustments to portfolio weights.
Options Pricing
European Options — Black-Scholes
American Options — Barone-Adesi Whaley (BAW)
American-style options cannot be priced with Black-Scholes due to early exercise. MAISNER implements the Barone-Adesi Whaley approximation, which provides a closed-form solution by decomposing the American option into a European component and an early exercise premium.
Implied Volatility
When live market prices are available, MAISNER back-calculates implied volatility using Brent's method — a bracketed root-finding algorithm that is guaranteed to converge. If the IV calculation fails (e.g., deep ITM/OTM with negligible time value), the platform falls back to historical volatility.
Bond Analytics
Duration and Convexity
Vasicek Interest Rate Model
Bond returns in stress scenarios and portfolio projections use the Vasicek mean-reverting short rate model for interest rate simulation.
| Parameter | Value |
|---|---|
| BOND_MAX | 60% of portfolio |
| CONVEXITY_THRESH | 0.05 |
| Credit ratings | AAA → CCC (FMP data) |
Factor Analysis
The Factor Explorer computes Information Coefficient (IC) and related statistics for 11 cross-sectional factors.
Information Coefficient
Information Ratio
| Factor | Category |
|---|---|
| momentum_12m | Momentum (12-1) |
| momentum_1m | Short-term reversal |
| value_composite | P/E, P/B, EV/EBITDA |
| quality_composite | ROE, margins, debt |
| low_volatility | 12-month realised vol |
| fcf_yield | FCF / Market cap |
| earnings_revision | EPS estimate changes |
| size | Log market cap |
| dividend_yield | Trailing dividend yield |
| growth_composite | Revenue + EPS growth |
| short_interest | Short % of float |
Backtesting & Deflated Sharpe Ratio
Walk-Forward Validation
All strategy backtests use walk-forward analysis: the strategy is fitted on a training window and evaluated on an out-of-sample test window that rolls forward in time. This prevents look-ahead bias and provides a realistic estimate of live performance.
Deflated Sharpe Ratio
Multiple testing bias is a major source of overfitting in quantitative strategies. MAISNER computes the Deflated Sharpe Ratio (DSR), which adjusts the observed Sharpe Ratio for the number of trials tested and the non-normality of returns.
Platform Constants
| Constant | Value | Description |
|---|---|---|
| RISK_FREE | 3.80% | Risk-free rate (annualised) |
| WEIGHT_MAX | 35% | Max weight per linear asset |
| CRYPTO_MAX | 15% | Max total crypto allocation |
| FUTURES_MAX | 20% | Max total futures allocation |
| BOND_MAX | 60% | Max total bond allocation |
| OPTION_MAX | 30% | Max total options allocation |
| LAMBDA_QUAL | 0.05 | Quality tilt penalty weight |
| QUALITY_THRESH | 0.30 | Min quality score threshold |
| MC_PATHS | 10,000 | Monte Carlo simulation paths |
| MC_HORIZON | 10 years | Monte Carlo time horizon |
| CVAR_SCENARIOS | 5,000 | CVaR scenario count |
| CVAR_ALPHA | 0.95 | CVaR confidence level |
| DATA_HISTORY | 10 years | Price history for analysis |
| STALENESS | 30 days | Max data age before refresh |
Data sources: FMP Professional (primary — fundamentals, prices, dividends), Polygon (secondary — US equities), yfinance (EU tickers, fallback). All data fetched over HTTPS with API key authentication.