INVEST: statistical analysis, Monte Carlo and AI

Joint sampling, global sensitivity, model mixtures and forecast evaluation, with AI analysts coordinated by the numerical engine.

INVEST · Python desktop application · In development

Economic models and statistical engines

INVEST is a Python desktop application connecting business models, probabilistic simulation, market analysis and comparisons between AI proposals.

The business model is a graph of variables and equations linking revenue, margins, cash flows, debt and share count. When configured, the standard financial mode adds financing, dilution, reinvested dividends and insolvency. The analysis engines reuse this evaluator to examine the same economic assumptions.

The Amplifon numerical case maps three independent triangular distributions—growth, EBITDA margin and EV/EBITDA—into a distribution of value per share at 2031. The archived 20,000-draw sample provides quantiles and probabilities; its Monte Carlo error is estimated separately. Variance attribution uses a new Sobol design on the same model.

Application example: Amplifon, 20,000 scenarios

The test saved on 4 November 2026 uses the standalone Amplifon model, with valuation date 3 November 2026 and horizon 3 November 2031. Revenue evolves using sampled growth; the margin determines EBITDA and the multiple determines terminal operating value. The bridge to equity includes the model’s financial components.

Triangular assumptionMinimumModeMaximum
Revenue growth−1%3.5%7%
EBITDA margin19%22%24%
EV/EBITDA multiple6×8×11×

These are proposed model assumptions, not statistically estimated intervals. The test records 20,000 simulations without numerical failures and 1,000 bootstrap resamples. Economic approval and forecast registration are both recorded as not completed.

Recorded outputValueMeaning
5th percentile€10.405% of simulated scenarios fall below this value
Median€14.68Half the scenarios fall below this value
95th percentile€20.045% of simulated scenarios exceed this value
Mean€14.88Mean terminal value per share
Loss probability11.37%Share below the case’s initial price of €11.395

Returns are price-based: reinvested dividends and insolvency are not modelled in this particular test. The reported loss probability therefore concerns the price model alone.

Amplifon empirical distribution: 20,000 draws, 50 bins and P5, P50 and P95 quantiles.
Empirical distribution of the archived sample: all 50 frequencies were reproduced by the engine, together with the mean, quantiles and loss probability. P5 and P95 bound the central 90% of the sample, not a confidence interval. Open original ↗
Empirical Amplifon CDF: 11.37% probability below €11.395.
Reading probability from the empirical CDF. The initial €11.395 threshold has 2,274 outcomes below it out of 20,000: loss probability 11.37%, with an exact 95% binomial interval of 10.93–11.82%. The calculation uses the full sample, not histogram bin heights. Open original ↗

The three drivers are independent in this run. The central 90% of scenarios is €10.40–€20.04, while the mean’s 95% confidence interval is €14.84–€14.92, with a Monte Carlo standard error of about €0.021.

Joint sampling and reproducibility

The sampler implements triangular, uniform, lognormal and discrete distributions, the bounded normal of the ARK reference, and annual AR(1) and random-walk processes. Quantile transformations retain each driver’s specified marginal distribution. Events and occurrence years have separate random streams.

Driver dependence uses a Gaussian copula. An eigenvalue decomposition computes the symmetric correlation-matrix root and supports singular positive-semidefinite matrices. Correlations refer to latent Gaussian variables; correlations of transformed drivers may differ. Marginals and the correlation matrix are model inputs.

The Philox generator assigns streams to stable driver and event identifiers. Changing block size preserves draws; scenario and proposal comparisons use common random numbers. NumPy calculations run in blocks and reuse the compiled graph.

Amplifon mean value and 95% Monte Carlo intervals for prefixes of 256 to 65,536 simulations.
Same Philox stream, seed 0: each point extends the preceding sample prefix. The band is a pointwise asymptotic 95% Student-t interval for the mean, not an outcome band. At 20,000 draws the mean is €14.8792 and its standard error is €0.0207. The extension to 65,536 is a new numerical check dated 10 November. Open original ↗

The mean’s standard error falls from €0.193/share at 256 simulations to €0.0114/share at 65,536. Mean fluctuations and interval contraction are measured on prefixes of the same stream, without selecting samples according to their outcomes.

Distributions, losses and estimator precision

The statistical engine computes means, quantiles, probabilities of loss or returns below a target, and expected shortfall, the mean loss in the worst 5% of the loss distribution. Proportion intervals are exact binomial intervals; quantiles and expected shortfall use bootstrap intervals. Means have standard errors and confidence intervals.

Monte Carlo intervals are conditional on the model’s distributions and equations; they do not include parameter-estimation error or misspecification of economic relationships. Insolvent simulations remain economic outcomes when insolvency is modelled; numerical failures have separate diagnostics.

In the Amplifon case, the P5–P95 span is €9.64/share; the mean’s 95% interval spans approximately €0.081/share. The former describes model-outcome dispersion; the latter describes how precisely the sample estimates its mean. Quantiles also have Monte Carlo error: the P95 interval is €19.95–20.14.

95% intervals for P5, median, mean and P95, expressed as deviations from each estimate.
Estimator precision in the 20,000-draw sample. Each point is centred on its own estimate; bars show deviations of the 95% interval endpoints. Quantiles: 1,000 percentile-bootstrap replicates (cyan). Mean: Student-t interval (amber). All four bars share the €/share scale. Open original ↗

Global sensitivity: Morris, Sobol and Shapley

Sensitivity analysis reuses the business evaluator, with a plan counting model evaluations before execution.

MethodOutputCondition of use
TornadoOutput change at the extremes of one driverOther drivers at their medians; one driver varied at a time
MorrisSigned mean, absolute mean and dispersion of elementary effectsExploration of a finite domain; not a decomposition of the original variance
SobolFirst-order and total indices, with bootstrap intervalsIndependent factors; centred Saltelli and Jansen estimators
ShapleyVariance allocation through coalitions and permutationsConditional sampling consistent with modelled dependence

Unselected drivers and events are grouped into the residual factor used to calculate overall variance. Shapley conditioning uses pseudoinverses for singular matrices; correlated discrete or saturated marginals require rejection sampling. Exhausting the allowed attempts stops the design with a diagnostic.

Rank correlations between drivers and outputs are reported separately from sensitivity indices. Sobol and Shapley retain estimated indices even when they are negative or above one. Indices are not reported when variance is zero.

First-order and total Sobol indices for the three Amplifon drivers, with 90% bootstrap intervals.
New design on the Amplifon model: 32,768 rows per matrix, 163,840 evaluations, seed 17 and 1,000 paired bootstrap replicates. Cyan: first order; amber: total effect, including interactions. Bars: 90% bootstrap intervals, as implemented by the sensitivity engine. Open original ↗

For the three independent Amplifon drivers, first-order indices are approximately 0.648 for the multiple, 0.261 for growth and 0.095 for margin. Total indices are 0.650, 0.268 and 0.097, respectively. Under the chosen marginals, the multiple’s contribution is mainly its own first-order effect. Estimated total-minus-first-order gaps are approximately 0.002, 0.007 and 0.002. Estimated first-order indices sum to 1.004; the calculation retains Monte Carlo error without renormalising them.

Inverse analysis, thresholds and scenarios

Inverse analysis searches for growth, margins or other driver values compatible with a target price or required return. It explores a declared grid and refines continuous crossings with Brent’s method, checking the solution residual.

A jump caused by insolvency, financing or a discrete driver is recorded as a crossing threshold. The search distinguishes verified roots, discontinuities and non-computable points; grid resolution limits which roots can be detected. Two-driver frontiers and event-probability curves reuse the same sample for the remaining factors.

Time series and market-context distributions

The market module selects observations by when they became available, including revisions. It computes price, sector and macroeconomic indicators, exposures and covariances on aligned series. Outputs identify which data families are available.

The analogue estimator selects neighbouring historical paths in a feature space standardised within the estimation window. It resamples complete paths using a shared index across factors, preserving covariance and within-path dependence. Insufficient support or current features outside the admissible domain produce abstention.

A ridge regression supplies a separate quantitative reference, with a recorded penalty and an unpenalised intercept. The conditional-mean standard error assumes uncorrelated homoscedastic errors and a fixed penalty. Descriptive regimes combine momentum and volatility; transition estimates use counts with a Dirichlet prior and marginal Beta intervals.

Forecast evaluation and context admission

Distributions are compared with realised outcomes using CRPS; event probabilities use the Brier score. Interval coverage and errors are also computed. Estimation, validation and final testing use separate periods, with information-availability checks at each origin.

The admission protocol compares CRPS(integrated) − CRPS(baseline) at the same origin and against the same realised outcome. Its numerical core implements circular block bootstrap over forecast origins and 95% simultaneous intervals across the candidate family. The criterion requires a negative mean and an interval upper bound below zero for two block lengths. The evaluation sample size is the number of forecast origins.

Admission also requires baseline and integrated business models available at their respective origins, verified sources and compatible return bases. Economic approval remains a separate decision.

AI panel: proposals, counterfactuals and revision

Orchestration prepares a shared package of data and sources available before the cutoff, collects independent drafts, runs checks, comparisons and mutual criticism, then performs targeted research and revision. The numerical engine calculates the consequences of proposals. Schema, units, accounting, dates and evidential support are checked before a draft is used.

Comparison distinguishes parameter differences from changes to model structure. For semantically compatible parameters, a counterfactual substitutes one value at a time in both directions and measures changes in expected price and median CAGR using common random numbers. Structural differences retain complete models.

Roles are assigned to available providers; local calculations remain accessible without providers. Economic assumptions remain proposals until a human decision.

Model mixtures and variance decomposition

The mixture engine combines complete empirical distributions with explicit weights: F(x) = Σ w_m F_m(x). A model’s weight is independent of its sample size. Quantiles and probabilities come from the weighted CDF; component parameters remain separate.

Mixture variance is the sum of the weighted mean of within-model variances and the weighted variance of model means. Weights are set explicitly before combination.

Numerical tests and historical comparison

Repository tests compare Sobol and Shapley indices with analytical cases, check roots and discontinuities in inverse problems, and verify mixtures and CRPS by direct enumeration. The historical comparison between baseline and integrated business models remains incomplete.

Let’s discuss your computational engine

We start with the equations, data and constraints on accuracy, memory and time.