Analysing Population Synthesis

Analysing Population Synthesis#

In this example we show how to examine the performance of the Population Synthesizer.

sphinx_gallery_thumbnail_path = ‘../../examples/result_analysis/pop_synth.png’

from pathlib import Path

from polaris.analyze.popsyn_analysis import PopsynComparator
from polaris.utils.logging_utils import stdout_logging  # noqa: E402

stdout_logging()
project_dir = Path("/tmp/Bloomington")
iteration_folder = project_dir / "Bloomington_iteration_4"
sample_factor = 0.25
comp = PopsynComparator(iteration_folder, sample_factor)
comp.summarise()
2024-07-08T10:05:59+0000 Synthesized 99.87% of households - synthesized = 65,868, sf1 marginal = 65,956
2024-07-08T10:05:59+0000 Synthesized 91.33% of people     - synthesized = 158,228, sf1 marginal = 173,254

Comparison against controls#

When examining the below plots, the column title refers to the kind of control variable - household (HH) or person (PERSON) level. Note that columns starting with TEST are not directly controlled to.

PUMA level#

Note that linear regression stats will be meaningless for a model with one PUMA only, as is the case here.

comp.generate_comparison_plots(geo_level=1)
HHT_OWN_FAM_MAR, HHS_1, AGE<5, RACE_WHT, HHT_OWN_FAM_MAL, HHS_2, AGE_5_9, RACE_BLK, HHT_OWN_FAM_FEM, HHS_3, AGE_10_14, RACE_IND, HHT_OWN_NON_FAM, HHS_4, AGE_15_19, RACE_ASN, HHT_RENT_FAM_MAR, HHS_5, AGE_20_24, RACE_HAW, HHT_RENT_FAM_MAL, HHS_6, AGE_25_29, RACE_OTH, HHT_RENT_FAM_FEM, HHS_7+, AGE_30_34, RACE_TWO, HHT_RENT_NON_FAM, AGE_35_39, RACE_HSP, AGE_40_44, AGE_45_49, AGE_50_54, AGE_55_59, AGE_60_64, AGE_65_69, AGE_70_74, AGE_75_79, AGE_80_84, AGE_85_+

Tract level#

comp.generate_comparison_plots(geo_level=0)
HHT_OWN_FAM_MAR, HHS_1, AGE<5, RACE_WHT, HHT_OWN_FAM_MAL, HHS_2, AGE_5_9, RACE_BLK, HHT_OWN_FAM_FEM, HHS_3, AGE_10_14, RACE_IND, HHT_OWN_NON_FAM, HHS_4, AGE_15_19, RACE_ASN, HHT_RENT_FAM_MAR, HHS_5, AGE_20_24, RACE_HAW, HHT_RENT_FAM_MAL, HHS_6, AGE_25_29, RACE_OTH, HHT_RENT_FAM_FEM, HHS_7+, AGE_30_34, RACE_TWO, HHT_RENT_NON_FAM, AGE_35_39, RACE_HSP, AGE_40_44, AGE_45_49, AGE_50_54, AGE_55_59, AGE_60_64, AGE_65_69, AGE_70_74, AGE_75_79, AGE_80_84, AGE_85_+

Total running time of the script: (0 minutes 10.556 seconds)

Gallery generated by Sphinx-Gallery