Skip to main content

PopGen3

Introduction

PopGen is a state-of-the-art open-source synthetic population generator for advanced travel demand modeling. Developed under the guidance of Professor Ram M. Pendyala at Arizona State University, PopGen utilizes both heuristic algorithms (IPU) and entropy-based methods to control and match both household-level and person-level attribute distributions, synthesizing realistic population data.

Key Features

  • Advanced control of household and person variables across multiple geographic resolutions (region and geo).
  • Command-line interface for simplified usage and enhanced computational efficiency.
  • Fully compatible with Python 3, with updated dependencies.

Previous Version

For insights into the earlier versions of PopGen, please refer to the legacy PopGen webpage. This resource provides access to previous versions, detailed descriptions of software objectives, and paper references.

Run PopGen3 Online

  • Binder: A cloud-based Jupyter notebook with step-by-step tutorials for data input understanding and output visualization.

    Binder

  • Colab: Provides a cloud-based environment for executing PopGen3 code and downloading result packages.

    Open In Colab

Contents

Data Inputs

Survey sample data:

household_sample.csv
person_sample.csv

Population marginal data:

  • geo-level marginals:
    person_marginals.csv
    household_marginals.csv

  • region-level marginals:
    region_person_marginals.csv
    region_household_marginals.csv

Multi-Geographic Resolution Mapping Data:

region_geo_mapping.csv
geo_sample_mapping.csv

Example of Multi-Geographic Resolution Levels:

  • Region Level: Set as census county subdivision
  • Geo Level: Set as census tracts
  • Sample Geo Level: Set as Public Use Microdata Areas (PUMAs)

Configuration File

The configuration.yaml file contains several key sections for the PopGen setup.

Designed Input Keys

Project Wide Setting Input Data Files Scenario Settings
- synthesize
- name
- location
- entities
- column_names
- location
- description
- apply_region_controls
- control_variables
- parameters
- geos_to_synthesize
- outputs

Entity names are free (person, adult, ...). When household and person controls cannot all be met at once, IPU gives priority to the entities listed under housing_entities: their totals are matched exactly and the person totals as closely as possible (Ye et al., 2009). Since 3.0.5 this does not depend on how the entities are named.

Results Outputs

Sample Weighting Results:

weights.csv

Generated Synthetic Population:

housing_synthetic.csv
person_synthetic.csv

Diagnostics (new in 3.0.5):

reweighting_fit_summary.csv - for every geography and entity, how closely the weighted sample matches the control totals (margin_* columns) and the IPF multiway cells (cell_* columns). It is written wherever reweighting_average_diffs.csv is (always in weights-only runs; with performance: [reweighting] otherwise). Judge the fit by the margin_* columns: at region level the cell targets come from a separate IPF on the region seed, which IPU does not finish on, so large region-level cell_* values are expected.

Input checks and errors (new in 3.0.5)

Before IPF, PopGen checks the inputs (duplicate household ids, missing values in control variables, categories present in the sample but not in the marginals and vice versa, control totals that disagree, geographies without sample records) and logs what it finds. The checks never change results. To stop a scenario when they find errors, add to the scenario (or project):

validation:
  strict: true

or run popgen --strict config.yaml / popgen.run("config.yaml", strict=True).

If a scenario fails, popgen.run now raises popgen.ScenarioError (after attempting all scenarios) and the popgen command exits with status 1; earlier versions only logged the error.

Testing

pip install -e ".[test]"
pytest                                   # golden-output, accuracy, validation and CLI tests
POPGEN_DIFFERENTIAL=1 pytest             # also compare every output with popgen3 3.0.4 from PyPI

The golden tests require the outputs to stay byte-for-byte identical to release 3.0.4; see CHANGELOG.md for the history of numerical changes between releases.

Metadata

Release files for popgen3 3.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for popgen3 3.0.5
File Size Uploaded Provenance Actions
popgen3-3.0.5.tar.gz 51.0 kB Without provenance Details for popgen3-3.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for popgen3 3.0.5
File Interpreter ABI Platform Actions
popgen3-3.0.5-py3-none-any.whl Python 3 none any Details for popgen3-3.0.5-py3-none-any.whl

Total release size: 95.6 kB

Release files / popgen3-3.0.5.tar.gz

Download URL popgen3-3.0.5.tar.gz
Size 51.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0bb21e3e7abf88e0a66b09b2b2ab5d8952f9ef1995f170c9a42bf45a1ef51675
BLAKE2b-256 checksum
How to use checksums
d46ae008d3eb05e0ab9b3e6edbd287a5ae52f1e0276a062bd1028866021b397d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Release files / popgen3-3.0.5-py3-none-any.whl

Download URL popgen3-3.0.5-py3-none-any.whl
Size 44.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d868dca16665e776224762d8bbc93681360b1e6a0551f8db03db42402773608c
BLAKE2b-256 checksum
How to use checksums
df5563e9126b0fb54f11cd97ed68a7f3239ade04c194d273c3e7315dd6e6dae3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.1

Security for popgen3 3.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page