Closed mzhao80 closed 1 year ago
Thanks for the PR. For the summary stats at the bottom something is going wrong. Make sure redist
is loaded when you run them. You should see simulation-specific details rather than a bunch of quantile summaries by column.
Also, we're seeing a lot of county splits relative to the enacted. Can you try using the same approach we did for 2020 with combined county/cores, rather than just doing the cores?
https://github.com/alarm-redist/fifty-states/blob/main/analyses/NE_cd_2020/02_setup_NE_cd_2020.R#L14
Also I don't see the tracker updated even though you checked that box. Can you update it?
This tracker should be updated.
SMC: 5,000 sampled plans of 3 districts on 1,652 units
`adapt_k_thresh`=0.985 • `seq_alpha`=0.5
`est_label_mult`=1 • `pop_temper`=0
Plan diversity 80% range: 0.046 to 0.348
x WARNING: Low plan diversity
R-hat values for summary statistics:
pop_overlap total_vap plan_dev comp_edge comp_polsby pop_white pop_black
1.002241 1.018813 1.002465 1.002012 1.003524 1.009250 1.008240
pop_hisp pop_aian pop_asian pop_nhpi pop_other pop_two vap_white
1.001504 1.018715 1.011499 1.000690 1.013433 1.006200 1.011990
vap_black vap_hisp vap_aian vap_asian vap_nhpi vap_other vap_two
1.006314 1.001898 1.022521 1.010333 1.000712 1.006381 1.003616
pre_16_rep_tru pre_16_dem_cli pre_20_rep_tru pre_20_dem_bid uss_18_rep_fis uss_18_dem_ray uss_20_rep_sas
1.004838 1.002289 1.005753 1.002669 1.003266 1.001871 1.003180
uss_20_dem_jan gov_18_rep_ric gov_18_dem_kri atg_18_rep_pet sos_18_rep_evn sos_18_dem_dan adv_16
1.002544 1.003182 1.002072 1.002858 1.003771 1.001827 1.002289
adv_18 adv_20 arv_16 arv_18 arv_20 county_splits muni_splits
1.002103 1.002479 1.004838 1.002806 1.004281 1.004378 1.005061
ndv nrv ndshare e_dvs e_dem pbias egap
1.002243 1.003310 1.003992 1.003951 1.005790 1.000858 1.004215
Sampling diagnostics for SMC run 1 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,074 (85.9%) 3.4% 0.22 779 ( 99%) 10
Split 2 765 (61.2%) 2.3% 0.56 612 ( 77%) 6
Resample 338 (27.1%) NA% 1.63 595 ( 75%) NA
Sampling diagnostics for SMC run 2 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,066 (85.2%) 4.1% 0.21 789 (100%) 8
Split 2 754 (60.3%) 3.0% 0.59 587 ( 74%) 5
Resample 320 (25.6%) NA% 1.67 594 ( 75%) NA
Sampling diagnostics for SMC run 3 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,067 (85.4%) 4.2% 0.21 793 (100%) 8
Split 2 800 (64.0%) 2.8% 0.55 588 ( 74%) 5
Resample 375 (30.0%) NA% 1.59 624 ( 79%) NA
Sampling diagnostics for SMC run 4 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,081 (86.5%) 3.0% 0.21 798 (101%) 11
Split 2 805 (64.4%) 2.3% 0.53 619 ( 78%) 6
Resample 379 (30.3%) NA% 1.60 649 ( 82%) 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.
• Low diversity: Check for potential bottlenecks. Increase the number of samples. Examine the diversity plot
with `hist(plans_diversity(plans), breaks=24)`. Consider weakening or removing constraints, or increasing
the population tolerance. If the accpetance rate drops quickly in the final splits, try increasing
`pop_temper` by 0.01.
NOTE: Cores constraint limits max VI distance. Did 4 independent runs rather than 2 to maximize diversity. @CoryMcCartan
Hm, diversity is still lower than we'd like (cf the first draft you had). What happens if you remove the additional custom constraint and just run with the built-in county constraint?
Hm, diversity is still lower than we'd like (cf the first draft you had). What happens if you remove the additional custom constraint and just run with the built-in county constraint?
We see significant improvement with plan weights and diversity but more county splits.
SMC: 5,000 sampled plans of 3 districts on 1,652 units
`adapt_k_thresh`=0.985 • `seq_alpha`=0.5
`est_label_mult`=1 • `pop_temper`=0
Plan diversity 80% range: 0.079 to 0.416
x WARNING: Low plan diversity
R-hat values for summary statistics:
pop_overlap total_vap plan_dev comp_edge comp_polsby pop_white pop_black
1.0012230 1.0008035 0.9998143 1.0008056 1.0006819 1.0000933 1.0016689
pop_hisp pop_aian pop_asian pop_nhpi pop_other pop_two vap_white
1.0001511 1.0014075 1.0018163 1.0000299 1.0005896 1.0017560 1.0008699
vap_black vap_hisp vap_aian vap_asian vap_nhpi vap_other vap_two
1.0012753 1.0003513 1.0010595 1.0016024 1.0004983 1.0004933 1.0012645
pre_16_rep_tru pre_16_dem_cli pre_20_rep_tru pre_20_dem_bid uss_18_rep_fis uss_18_dem_ray uss_20_rep_sas
0.9999929 1.0014798 0.9998098 1.0015018 0.9997766 1.0008385 0.9999236
uss_20_dem_jan gov_18_rep_ric gov_18_dem_kri atg_18_rep_pet sos_18_rep_evn sos_18_dem_dan adv_16
1.0016203 0.9997972 1.0012770 1.0000743 0.9997355 1.0011326 1.0014798
adv_18 adv_20 arv_16 arv_18 arv_20 county_splits muni_splits
1.0011208 1.0015479 0.9999929 0.9998232 0.9998810 1.0014544 1.0015087
ndv nrv ndshare e_dvs e_dem pbias egap
1.0012823 0.9997661 1.0015310 1.0015011 1.0006474 0.9998004 1.0008763
Sampling diagnostics for SMC run 1 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,237 (98.9%) 3.2% 0.21 801 (101%) 10
Split 2 1,216 (97.3%) 2.4% 0.33 657 ( 83%) 6
Resample 1,105 (88.4%) NA% 0.32 1,091 (138%) NA
Sampling diagnostics for SMC run 2 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,236 (98.9%) 4.3% 0.21 784 ( 99%) 8
Split 2 1,224 (97.9%) 2.9% 0.29 649 ( 82%) 5
Resample 1,145 (91.6%) NA% 0.29 1,111 (141%) NA
Sampling diagnostics for SMC run 3 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,236 (98.9%) 4.2% 0.21 794 (100%) 8
Split 2 1,225 (98.0%) 2.8% 0.29 638 ( 81%) 5
Resample 1,152 (92.1%) NA% 0.28 1,095 (139%) NA
Sampling diagnostics for SMC run 4 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,236 (98.9%) 3.1% 0.21 803 (102%) 11
Split 2 1,221 (97.7%) 2.1% 0.31 635 ( 80%) 7
Resample 1,135 (90.8%) NA% 0.30 1,098 (139%) 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.
• Low diversity: Check for potential bottlenecks. Increase the number of samples. Examine the diversity plot
with `hist(plans_diversity(plans), breaks=24)`. Consider weakening or removing constraints, or increasing
the population tolerance. If the accpetance rate drops quickly in the final splits, try increasing
`pop_temper` by 0.01.
Hm something is going wrong with how the counties/cores are set up. See the old PR & how we are able to limit county splits to 2 or less: https://github.com/alarm-redist/fifty-states/pull/96
Have you tried plotting the cores/counties? How does that look?
Implement fixes.
SMC: 5,000 sampled plans of 3 districts on 1,652 units
`adapt_k_thresh`=0.985 • `seq_alpha`=0.5
`est_label_mult`=1 • `pop_temper`=0
Plan diversity 80% range: 0.11 to 0.45
x WARNING: Low plan diversity
R-hat values for summary statistics:
pop_overlap total_vap plan_dev comp_edge comp_polsby pop_white pop_black pop_hisp
1.0003055 1.0004240 1.0000593 1.0007905 1.0000287 0.9998696 1.0001040 1.0014082
pop_aian pop_asian pop_nhpi pop_other pop_two vap_white vap_black vap_hisp
1.0001982 1.0004675 0.9997999 1.0001641 1.0002904 1.0002738 1.0001107 1.0011856
vap_aian vap_asian vap_nhpi vap_other vap_two pre_16_rep_tru pre_16_dem_cli pre_20_rep_tru
0.9999343 1.0004032 0.9999556 0.9997093 1.0000821 1.0012069 1.0002471 1.0007071
pre_20_dem_bid uss_18_rep_fis uss_18_dem_ray uss_20_rep_sas uss_20_dem_jan gov_18_rep_ric gov_18_dem_kri atg_18_rep_pet
1.0010140 1.0006886 1.0005293 1.0006475 1.0005141 1.0002943 1.0003369 0.9999296
sos_18_rep_evn sos_18_dem_dan adv_16 adv_18 adv_20 arv_16 arv_18 arv_20
1.0004149 1.0003144 1.0002471 1.0003520 1.0008157 1.0012069 1.0003822 1.0005244
county_splits muni_splits ndv nrv ndshare e_dvs e_dem pbias
0.9997579 1.0000198 1.0004680 1.0006237 1.0000495 1.0000453 1.0003679 1.0001791
egap
1.0010406
Sampling diagnostics for SMC run 1 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,236 (98.8%) 3.4% 0.22 795 (101%) 10
Split 2 1,221 (97.7%) 2.2% 0.30 652 ( 83%) 6
Resample 1,128 (90.3%) NA% 0.29 1,101 (139%) NA
Sampling diagnostics for SMC run 2 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,235 (98.8%) 5.6% 0.22 786 ( 99%) 6
Split 2 1,212 (97.0%) 3.3% 0.33 682 ( 86%) 4
Resample 1,078 (86.3%) NA% 0.32 1,096 (139%) NA
Sampling diagnostics for SMC run 3 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,236 (98.9%) 4.2% 0.21 810 (103%) 8
Split 2 1,224 (97.9%) 2.7% 0.29 659 ( 83%) 5
Resample 1,143 (91.4%) NA% 0.29 1,097 (139%) NA
Sampling diagnostics for SMC run 4 of 4 (1,250 samples)
Eff. samples (%) Acc. rate Log wgt. sd Max. unique Est. k
Split 1 1,235 (98.8%) 5.0% 0.22 772 ( 98%) 7
Split 2 1,220 (97.6%) 3.5% 0.31 672 ( 85%) 4
Resample 1,120 (89.6%) NA% 0.30 1,100 (139%) 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.
• Low diversity: Check for potential bottlenecks. Increase the number of samples. Examine the diversity plot with
`hist(plans_diversity(plans), breaks=24)`. Consider weakening or removing constraints, or increasing the population tolerance. If the acceptance rate drops quickly in the final splits, try increasing `pop_temper` by 0.01.
NOTE: Cores constraint limits max VI distance. Did 4 independent runs rather than 2 to maximize diversity. @CoryMcCartan
2010 Nebraska Congressional Districts
Redistricting requirements
In Nebraska, districts must, under a legislative resolution:
Interpretation of requirements
We enforce a maximum population deviation of 0.5%. We apply a county constraint. We preprocess the map to ensure the cores of prior districts are preserved, as described below.
Data Sources
Data for Nebraska comes from the ALARM Project's Redistricting Data Files.
Pre-processing Notes
To preserve the cores of prior districts, we merge all precincts which are more than two precincts away from a district border under the 2000 plan.
Simulation Notes
We sample 5,000 districting plans for Nebraska. In addition to a county constraint applied to the residual counties left over from the cores operation, we apply an additional Gibbs constraint of strength 1.5 to avoid splitting counties.
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