Skip to content

PolicyEngine/populace-dynamics

Repository files navigation

Populace dynamics

Design paper: a citable distillation of this book is published at https://populace.dev/papers/dynamics (web and PDF).

This repository contains the design and validation program for populace's longitudinal Dynamics layer — an open, scored extension of PolicyEngine's country-agnostic microdata stack. Its first validation domain is U.S. Social Security, chosen because it forces lifetime earnings, family structure, disability, and claiming dynamics to be right. The goal is not to imitate government models superficially; it is to build public, inspectable infrastructure that answers serious policy questions with transparent methods and a published scoring record, in any country PolicyEngine models.

Why This Project Exists

Social Security policy analysis is dominated by models that are either internal to government or available only through contracts and specialized relationships. That creates three problems:

  1. Researchers and advocates cannot independently reproduce major policy estimates.
  2. Small organizations are effectively priced out of serious dynamic modeling.
  3. Public debate defaults to summaries of model output instead of open inspection of assumptions, errors, and tradeoffs.

PolicyEngine already solved the analogous cross-sectional problem: populace, built entirely from primary sources, replaced the earlier Enhanced CPS as the certified default U.S. microdata in policyengine.py after beating it on held-out accuracy. The next step is to make that population longitudinal. Social Security is the first serious proving ground because it forces the project to get lifetime earnings, family structure, disability, and claiming dynamics right.

Project Principles

  • Public-data first: the full pipeline should be reproducible from public or broadly accessible sources.
  • Validation before ambition: the project earns credibility only by passing explicit validation gates, not by promising everything up front.
  • Platform first, application second: the core population work belongs in populace; this repository is the first domain application and validation layer on top of it.
  • Social Security first: the first application is Social Security, not a universal lifecycle simulator.
  • Platform thinking: the architecture should preserve a path to adjacent domains such as SSI interactions, retirement adequacy, and eventually long-term care — and, because populace's kernel is country-agnostic, to other countries' pension and benefit systems.
  • Honest scope: this project is a serious research and infrastructure effort, not an 18-month substitute for SSA or CBO.

Decisions Already Made

  • Base population platform: populace is the population dataset and synthesis platform — built from primary sources and now the certified default U.S. microdata in policyengine.py.
  • Initial focus: extend populace longitudinally just far enough to support lifetime earnings, family structure, disability, claiming, and benefit calculation for Social Security reform analysis.
  • Validation standard: success requires matching baseline Social Security distributions and projections closely enough to support exploratory policy analysis, while also validating the underlying longitudinal population asset itself.
  • Development model: a stage-gated plan with go/no-go checkpoints after each major methodological hurdle.

What Success Looks Like

Proof of concept

  • A documented proof of concept extends populace from a public cross-sectional population into a credible longitudinal population asset.
  • The model matches key baseline distributions closely enough to justify continuation.
  • The repository contains a published validation report, not just a methods narrative.

Validated Social Security layer

  • A validated longitudinal populace can feed Social Security benefit calculations.
  • Family, disability, and claiming logic are implemented well enough to replicate published baseline distributions and selected reform analyses.
  • External reviewers can inspect the full pipeline and reproduce core results.

Public product

  • A public API and web interface expose the model for exploratory policy analysis.
  • The model supports a core set of reform packages, cohort analysis, and distributional outputs.
  • The documentation clearly distinguishes what is production-ready, what is experimental, and what remains out of scope.

Documentation Map

The main planning documents are a Quarto book in docs/:

Current Status

This repository is still a planning and documentation repository. There is no claim that a validated dynamic Social Security model exists yet. The immediate product is a stronger project plan for a longitudinal populace and a cleaner validation strategy for its first policy application.

Repository Structure

social-security-model/
├── docs/                  # Quarto planning documentation
├── reviews/               # Reviewer feedback used to strengthen the plan
├── README.md
└── pyproject.toml

After implementation begins, the repository is expected to add code for Social Security-specific validation, rules integration, simulation, tests, and public-facing interfaces. The more generic population-layer work should live in populace or its related packages.

The harness (phase 0)

Implementation starts with the scoring harness, before any transition model — the order the design paper specifies. src/populace_dynamics/ carries:

  • harness/metrics.py, harness/holdout.py, harness/views.py: the population-view harness, adapted from PolicyEngine/imputation-paper (weighted energy distance, PRDC coverage, weighted C2ST, the tail-sensitive block, person-paired holdout splits).
  • harness/panel.py: longitudinal views — PanelView projects person-period records into trajectory windows so the geometry blocks run on dynamics under one weight per trajectory, with a person-disjoint noise-floor reference.
  • harness/moments.py: the held-out panel-moment battery (mobility matrices, weighted change moments and autocorrelation, age-earnings profiles, zero-spell structure, discrete-state transition rates).
  • data/psid.py: fixed-width PSID readers driven by the products' own SPS layouts (see ~/PolicyEngine/psid-data).
  • gates.yaml: the pre-registered gate definitions; numeric thresholds lock before the first model run.
uv pip install -e ".[dev]"
uv run pytest -q

Building the Documentation

quarto render docs
quarto preview docs

Python developer tooling can be installed separately with pip install -e ".[dev]". Quarto itself is provided by the Quarto CLI, not by the Python package metadata.

Related Projects

Contact

License

MIT License.

About

Design and validation program for populace's Dynamics layer — an open, scored longitudinal extension of PolicyEngine's microdata stack. First validation domain: U.S. Social Security.

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages