The Knowable Future
Python code: quantifying forecastability through predictive information
Auto-mutual information analysis
Python implementation for estimating horizon-specific lag-pair auto-mutual information (AMI) on first differences. At each horizon h it estimates I(ΔXₜ; ΔXₜ₊ₕ), the predictive information the current difference carries about the difference h steps ahead, for a declared single-observation information set. It is one forecastability diagnostic, not a general estimator of all predictive information available from the full history.
The script always takes first differences before estimating, which removes trend and level persistence. AMI computed on first differences describes predictive information in the differenced process, not an adjusted estimate of forecastability in the original levels.
The resulting profiles characterise horizon-specific dependence. Model choice requires separate out-of-sample evaluation because stronger measured dependence does not by itself identify which forecasting method will exploit it best. Every series is assessed over the same horizons (24 by default) and described as low, moderate or high lag-pair AMI; these classes describe dependence and do not recommend a forecasting method.
Outputs:
-
Per-series AMI profile charts showing the raw series alongside its AMI profile
-
Low, moderate or high lag-pair AMI class for each series
-
Results CSVs: AMI by horizon, and a per-series summary
Dependencies:
-
Python 3.9+
-
numpy
-
pandas
-
matplotlib
-
seaborn
-
scikit-learn