Closed emmaebowe closed 1 year ago
@emmaebowe, it looks like there are some code/github issues:
*.x
and *.y
). Do you know what happened there?The substance (summary stats, plans, and rhats) all look good to me! Thanks
@christopherkenny File issues should be resolved now! I got a warning about GEOID10 when I ran the code, could that have caused the summary stats duplication?
Summary stat duplication should be resolved!
Great, can we just get a new rhat (i.e. summary(plans)
) with that removed then! I think we're just about good to merge.
✔ Saving <redist_plans> object ... done
SMC: 5,000 sampled plans of 8 districts on 1,859 units
`adapt_k_thresh`=0.985 • `seq_alpha`=0.5
`est_label_mult`=1 • `pop_temper`=0
ℹ Preparing MD shapefile
Plan diversity 80% range: 0.46 to 0.77
ℹ Preparing MD shapefile
R-hat values for summary statistics:
pop_overlap
1.010844
Sampling diagnostics for SMC run 1 of 2 (2,500 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 2,454 (98.2%) 7.8% 0.27 1,545 ( 98%) 10
Split 2 2,417 (96.7%) 12.4% 0.37 1,540 ( 97%) 6
Split 3 2,390 (95.6%) 17.0% 0.42 1,591 (101%) 4
Split 4 2,369 (94.7%) 19.9% 0.47 1,551 ( 98%) 3
Split 5 2,348 (93.9%) 17.7% 0.49 1,529 ( 97%) 3
Split 6 2,337 (93.5%) 19.6% 0.51 1,472 ( 93%) 2
Split 7 2,316 (92.6%) 5.0% 0.53 1,353 ( 86%) 3
Resample 1,780 (71.2%) NA% 0.53 1,452 ( 92%) NA
Sampling diagnostics for SMC run 2 of 2 (2,500 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 2,455 (98.2%) 12.4% 0.27 1,587 (100%) 6
Split 2 2,412 (96.5%) 14.6% 0.38 1,590 (101%) 5
Split 3 2,387 (95.5%) 22.2% 0.43 1,535 ( 97%) 3
Split 4 2,371 (94.8%) 27.9% 0.47 1,533 ( 97%) 2
Split 5 2,345 (93.8%) 24.5% 0.49 1,542 ( 98%) 2
Split 6 2,253 (90.1%) 20.0% 0.59 1,484 ( 94%) 2
Split 7 2,170 (86.8%) 7.0% 0.68 1,306 ( 83%) 2
Resample 1,341 (53.6%) NA% 0.68 1,331 ( 84%) NA
• Watch out for low effective samples, very low acceptance rates (less than 1%), large
std. devs. of the log weights (more than 3 or so), and low numbers of unique plans. R-hat
values for summary statistics should be between 1 and 1.05.
ℹ Preparing MD shapefile
Looks like we are just about there. Can we just confirm that the other values are in the plans object? All I see is:
R-hat values for summary statistics:
pop_overlap
1.010844
Apologies, here's the full thing!
✔ Preparing MD shapefile ... done
SMC: 5,000 sampled plans of 8 districts on 1,859 units
`adapt_k_thresh`=0.985 • `seq_alpha`=0.5
`est_label_mult`=1 • `pop_temper`=0
ℹ Preparing MD shapefile
Plan diversity 80% range: 0.50 to 0.76
ℹ Preparing MD shapefile
R-hat values for summary statistics:
pop_overlap total_vap plan_dev comp_edge comp_polsby pop_white
1.0013274 1.0159530 1.0001856 1.0037702 1.0023219 1.0003998
pop_black pop_hisp pop_aian pop_asian pop_nhpi pop_other
1.0019676 1.0030604 1.0025138 1.0021432 1.0023543 1.0033762
pop_two vap_white vap_black vap_hisp vap_aian vap_asian
1.0085428 1.0020536 1.0037418 1.0024889 1.0018992 1.0021807
vap_nhpi vap_other vap_two pre_16_dem_cli pre_16_rep_tru pre_20_dem_bid
1.0006373 1.0007845 1.0051680 1.0030311 1.0009814 0.9998664
pre_20_rep_tru uss_16_dem_van uss_16_rep_sze uss_18_dem_car uss_18_rep_cam gov_18_dem_jea
1.0009971 0.9999793 1.0009498 1.0002865 1.0000787 1.0000215
gov_18_rep_hog atg_18_dem_fro atg_18_rep_wol adv_16 adv_18 adv_20
1.0000685 1.0016293 1.0003660 1.0012809 1.0020177 0.9998664
arv_16 arv_18 arv_20 county_splits muni_splits ndv
1.0031642 1.0002696 1.0009971 0.9998133 1.0228440 1.0014524
nrv ndshare e_dvs pr_dem e_dem pbias
1.0006835 1.0008000 1.0018574 1.0001566 1.0016806 1.0016444
egap
1.0025664
Sampling diagnostics for SMC run 1 of 2 (2,500 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 2,455 (98.2%) 8.0% 0.27 1,569 ( 99%) 10
Split 2 2,415 (96.6%) 12.2% 0.38 1,588 (100%) 6
Split 3 2,393 (95.7%) 17.2% 0.41 1,557 ( 99%) 4
Split 4 2,366 (94.6%) 19.7% 0.47 1,569 ( 99%) 3
Split 5 2,335 (93.4%) 13.5% 0.52 1,520 ( 96%) 4
Split 6 2,292 (91.7%) 14.4% 0.56 1,463 ( 93%) 3
Split 7 2,280 (91.2%) 7.0% 0.57 1,323 ( 84%) 2
Resample 1,692 (67.7%) NA% 0.58 1,428 ( 90%) NA
Sampling diagnostics for SMC run 2 of 2 (2,500 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 2,454 (98.1%) 13.2% 0.27 1,592 (101%) 6
Split 2 2,423 (96.9%) 18.6% 0.36 1,578 (100%) 4
Split 3 2,402 (96.1%) 16.8% 0.40 1,575 (100%) 4
Split 4 2,376 (95.0%) 12.1% 0.47 1,555 ( 98%) 5
Split 5 2,339 (93.6%) 12.8% 0.50 1,552 ( 98%) 4
Split 6 2,306 (92.3%) 13.3% 0.55 1,489 ( 94%) 3
Split 7 2,307 (92.3%) 4.8% 0.53 1,383 ( 88%) 3
Resample 1,742 (69.7%) NA% 0.55 1,461 ( 92%) NA
• Watch out for low effective samples, very low acceptance rates (less than 1%), large std.
devs. of the log weights (more than 3 or so), and low numbers of unique plans. R-hat values
for summary statistics should be between 1 and 1.05.
ℹ Preparing MD shapefile
2010 Maryland Congressional Districts
Redistricting requirements
In Maryland, districts must:
Algorithmic Constraints
We enforce a maximum population deviation of 0.5%.
Data Sources
Data for Maryland comes from the ALARM Project's 2020 Redistricting Data Files.
Pre-processing Notes
No manual pre-processing decisions were necessary.
Simulation Notes
We sample 5,000 districting plans for Maryland across 2 independent runs of the SMC algorithm. No special techniques were needed to produce the sample.
Validation
Checklist
TODO
lines from the template code have been removedenforce_style()
to format my coderedist_map
andredist_plans
objects, and summary statistics) have been edited@CoryMcCartan @christopherkenny @tylersimko