A statistical analysis framework for testing whether prediction market probabilities represent aleatory (objective, random) uncertainty or epistemic (subjective, knowledge-based) uncertainty.
This project implements rigorous statistical tests to determine whether prediction markets exhibit aleatory uncertainty - the property that outcomes are generated according to the predicted probability distributions. We analyze data from four major prediction market platforms using Monte Carlo simulations with directional statistical tests.
π None of the major prediction markets exhibit true aleatory uncertainty
- Manifold Markets: Systematically overconfident (predictions too extreme)
- Kalshi, Metaculus, Polymarket: Systematically underconfident (predictions too conservative)
See FINAL_REPORT.md for detailed analysis and implications.
- Python 3.8+
- Virtual environment (recommended)
# Clone repository
git clone https://github.com/arqwer/aleatory_or_epistemic.git
cd aleatory_or_epistemic
# Activate your virtual environment
source ~/work/viewapp/uvenv_viewapp/bin/activate
# Install dependencies
pip install numpy requestspython analyze_all_platforms.pyThis will:
- Fetch true midpoint probabilities from the Themis database
- Run 50,000 Monte Carlo simulations per test statistic
- Generate comprehensive reports for each platform
- Display cross-platform comparison
from prediction_markets_analysis import report_is_aleatory
import numpy as np
# Your prediction data
predictions = np.array([0.3, 0.7, 0.2, 0.8, 0.5])
outcomes = np.array([0, 1, 0, 1, 0])
# Run analysis
report_is_aleatory(predictions, outcomes, n_simulations=50000, platform_name="My Platform")Test the framework using synthetic datasets:
python validate_statistical_tests.pyThis creates four synthetic datasets (aleatory, underconfident, overconfident, mildly underconfident) and verifies that the statistical tests correctly identify each pattern.
aleatory_or_epistemic/
βββ README.md # This file
βββ FINAL_REPORT.md # Comprehensive analysis report
βββ is_aleatory.ipynb # Original methodology notebook
βββ prediction_markets_analysis.py # Core analysis framework
βββ analyze_all_platforms.py # Multi-platform analysis script
βββ validate_statistical_tests.py # Statistical test validation
βββ themis_*_cache.json # Cached market data
βββ all_platforms_results.txt # Latest analysis output
- Aleatory Uncertainty: Objective randomness (e.g., coin flips, quantum events)
- Epistemic Uncertainty: Subjective lack of knowledge (e.g., forecasting elections)
This project tests whether prediction market probabilities behave like aleatory probabilities.
Detect when predictions are too extreme (too far from 0.5):
- Expected Calibration Error (ECE)
- Cross-entropy
- Brier Score
- MSE from Calibration Diagonal
- Base Rate Deviation
Detect when predictions are too conservative (too close to 0.5):
- Negative Cross-entropy
- Negative Brier Score
- Monte Carlo Simulation: Generate synthetic outcomes from predicted probabilities
- Test Statistic Calculation: Compute calibration metrics on real and simulated data
- P-value Estimation: Proportion of simulations where synthetic data shows worse calibration than real data
- Bonferroni Correction: Adjust for multiple hypothesis testing
All prediction market data comes from Themis (https://brier.fyi), a comprehensive archive of prediction market history maintained by @wasabipesto.
We specifically use true temporal midpoint probabilities - the market probability at the exact temporal midpoint of each market's duration - to ensure we're testing genuine forecasts rather than near-resolution prices.
| Platform | Markets | Pattern | Cross-entropy p | Brier p | Conclusion |
|---|---|---|---|---|---|
| Manifold | 10,837 | Overconfident | 0.00000 *** | 0.00000 *** | Too extreme |
| Kalshi | 10,000 | Underconfident | 0.99998 | 0.99996 | Too conservative |
| Metaculus | 4,723 | Underconfident | 1.00000 | 1.00000 | Too conservative |
| Polymarket | 10,000 | Underconfident | 0.99998 | 1.00000 | Too conservative |
p-values for overconfidence tests (low p-value = overconfident)
This project follows strict coding standards:
- β All functions have type hints
- β All array shapes documented in docstrings
- β Comprehensive docstrings with side-effects noted
- β Input validation with descriptive assertions
- β Semantic variable names (no single-letter variables)
- β Fail-fast error handling
# Generate truly aleatory data
true_probs = np.random.uniform(0, 1, 1000)
outcomes = (np.random.random(1000) < true_probs).astype(int)
report_is_aleatory(true_probs, outcomes, 10000, "Aleatory Test")
# Expected: All p-values > 0.05 (accept aleatory hypothesis)# Shift probabilities away from 0.5
true_probs = np.random.uniform(0, 1, 1000)
overconfident_preds = 0.5 + 1.5 * (true_probs - 0.5) # Amplify distance from 0.5
overconfident_preds = np.clip(overconfident_preds, 0, 1)
outcomes = (np.random.random(1000) < true_probs).astype(int)
report_is_aleatory(overconfident_preds, outcomes, 10000, "Overconfident Test")
# Expected: Low p-values on overconfidence tests# Shift probabilities toward 0.5
true_probs = np.random.uniform(0, 1, 1000)
underconfident_preds = 0.5 + 0.5 * (true_probs - 0.5) # Reduce distance from 0.5
outcomes = (np.random.random(1000) < true_probs).astype(int)
report_is_aleatory(underconfident_preds, outcomes, 10000, "Underconfident Test")
# Expected: Low p-values on underconfidence tests, high on overconfidence testsThis is a research project. Contributions welcome for:
- Additional statistical tests
- New data sources
- Performance optimizations
- Documentation improvements
If you use this code or methodology in your research, please cite:
@software{aleatory_prediction_markets_2025,
author = {arqwer},
title = {Aleatory vs Epistemic Uncertainty in Prediction Markets},
year = {2025},
url = {https://github.com/arqwer/aleatory_or_epistemic}
}- Themis Database: https://github.com/wasabipesto/themis - Comprehensive prediction market archive
- Calibration Research: Brier Score, Expected Calibration Error, proper scoring rules
- Prediction Market Theory: Information aggregation, market microstructure
MIT License - See LICENSE file for details
For questions or collaboration opportunities, open an issue on GitHub.
- @wasabipesto for creating and maintaining the Themis database
- Prediction market platforms: Manifold Markets, Kalshi, Metaculus, Polymarket
- The forecasting and prediction market communities
Last Updated: October 10, 2025
Status: β
Analysis Complete