What is MatrixVoter? (In Plain English)
Traditional election polling is fundamentally broken. Pollsters spend weeks calling landline phones that young and mobile voters never answer, delivering stale snapshots by the time news cycles have already shifted.
MatrixVoter solves this by combining three real-time signals into a single probabilistic forecasting engine:
Live Betting Markets
Connects to Kalshi and Polymarket 24/7. When millions of dollars move on swing state odds, probabilities update instantly.
Census Demographics (MRP)
Breaks voters down by state, age, race, education, and urbanicity so no community is over- or under-represented.
AI Synthetic Electorate
Thousands of diverse AI voter personas deliberate in a small-world social network, reacting to inflation, policy news, and local peers.
How to Run What-If Simulations
The Policy Sandbox allows analysts, journalists, and voters to test hypothetical election scenarios interactively. Adjusting any slider recalculates state-by-state electoral odds in under 50 milliseconds.
Simulates shifts in suburban collar county engagement. Increasing this benefits college-educated suburban coalitions in critical Rust Belt and Sun Belt tipping-point states.
Models consumer confidence shocks, stock market swings, or unemployment spikes. Positive values lift the incumbent party baseline; negative values trigger national headwinds.
Simulates high vs. low college campus and Gen-Z turnout. High youth turnout expands margins in university counties in Madison, Ann Arbor, Maricopa, and Fulton counties.
Models grocery, gas, and housing cost-of-living sentiment. High inflation pressure shifts undecided and moderate swing voters toward the challenger.
Models non-metro voter turnout. High rural mobilization expands conservative margins and puts Rust Belt states in play.
How It Calculates (The Math in Plain English)
MatrixVoter uses a dual-pipeline statistical architecture: closed-form conjugate Bayesian updates in Polars for instant UI interactions, backed by PyMC Hierarchical GLMs.
Beta-Binomial Conjugacy (Polars)
Instead of running slow MCMC simulations on every slider move, MatrixVoter uses closed-form Bayesian math:
Vectorized across all 50 states using Polars column arrays, allowing instant updates in <15 milliseconds.
Multilevel Regression & Poststratification (MRP)
Instead of treating a state as a monolithic pool:
- Divides population into demographic slices (Strata).
- Estimates vote choice for each slice using hierarchical priors.
- Poststratifies (weights) using US Census population matrices.
AI Agent-to-Agent (A2A) Deliberation
MatrixVoter instantiates a synthetic electorate of diverse AI personas connected in a small-world social graph (Watts-Strogatz topology).
Each agent receives realistic demographic traits, occupation, concerns (e.g. mortgage rates, healthcare), and baseline political priors.
Agents are connected to realistic local social circles. When events occur, neighbors share thoughts and arguments.
Agents update beliefs based on confidence bounds. If an argument is persuasive and within their trust window, opinion shifts cascade through the community.
Connecting Live APIs & Feeds
MatrixVoter runs 100% offline out-of-the-box using synthetic Brownian drift and cognitive heuristic models. To connect live streaming prediction markets and LLMs, add your API keys to .env:
Enables GPT-4o-mini or Llama-3 to generate contextual reasoning for synthetic voters during town halls:
Connects to live CFTC-regulated political prediction markets:
Connects to Polymarket order books:
Gateway Health & Forwarding Troubleshooting
Gateway Log: "Could not forward tick to Python engine"
This message means the Rust Gateway generated/ingested a market tick, but the Python engine at GATEWAY_FORWARD_URL was temporarily busy or unreachable.
How to Resolve in Coolify or Docker Compose:
- Docker Compose Stack: Ensure both services are in the same network (e.g.
matrixvoter-prod-net) and the forward URL is set tohttp://engine:8000/api/v1/ingest/market-tick. - Separate Coolify Services: If deployed as separate items in Coolify, set
GATEWAY_FORWARD_URL=http://matrixvoter-engine-prod:8000/api/v1/ingest/market-tickor the internal Coolify DNS address. - Health Checks: The Gateway responds on
/healthand/api/v1/health. Ensure your health check is configured to check port8080on path/health.