Simulate Before You Deploy: A Python Stack for Econometric and System Simulation

How I build testable worlds for commodity carry trades and marketing measurement, with the tools, methods, and code that make the results worth trusting.

The five layers of a simulation study. Every result in this article comes from running code through this loop.

Every model that gets deployed into a market or a media plan is a bet that the world behaves the way the model assumes. A backtest checks that bet against one history. A holdout fit checks it against a slice of the same history. Neither tells you what happens when the assumptions are wrong, when the regime shifts, or when your own decisions start moving the system you are measuring.

Simulation fills that gap. You write down a world where the truth is known, run your estimator and your policy inside it thousands of times, and grade them against the answer key. Then you break the world on purpose and see what survives. This is how central banks have come to use agent-based models as complementary policy tools, and it is how the current generation of open-source marketing measurement libraries validates itself: the PyMC-Marketing documentation walks through parameter recovery on synthetic data before touching real data, and Google’s Meridian is built around calibrating models with experiment results.

Full article and code available on my substack: https://brianjamescurry.substack.com/

About the Author

Brian Curry is a Kansas City–based Machine Learning & AI Strategist, Marketing Economist, and Applied Researcher. He drives Vector1, a personal open-source research initiative advancing marketing economics, causal inference, cognitive AI architectures, and the economics of intelligent automation.

He has led advanced data science and analytics initiatives across major enterprises including Koch Industries, Tractor Supply, Hallmark, Garmin, and AT&T. His work applies economic thinking and causal inference to connect marketing investment to outcomes, operational decisions to economic value, and AI adoption to competitive advantage.

Key Research & Open-Source Projects (GitHub: @Bodhi8):

  • PyCausalSim — A Python framework for causal discovery and inference through simulation. Enables testing of counterfactual scenarios to identify true structural drivers.
  • Papilon — A complex system and causal discovery library for Media Mix Modeling (MMM) and adaptive systems.
  • Regimecast — Applied research and tooling for time-series regime detection and forecasting.
  • CarryNet — Open-source research and modeling focused on commodity carry trade analysis.
  • Foodmesh-ml — Machine learning, optimization, and simulation framework for modeling distributed food systems.
  • Memory-Node Encapsulation (MNE) — A cognitive AI architecture and novel data structure for artificial episodic memory.
  • The Autonomy Economy — A macroeconomic framework projecting the dual impacts of massive productivity growth and extreme price deflation in an AI-automated world.
  • Meaning-Flow — Research focused on semantic content modeling and automated coverage gap analysis.

Contact: brian at vector1.ai | Vector1 | GitHub | LinkedIn

This article may be shared with attribution under Creative Commons Attribution 4.0 International (CC BY 4.0).

Related research