- segregation.inference.simulate_evenness(df, group=None, total=None, groups=None)¶
Simulate even redistribution of population groups across spatial units.
geodataframe with population data to be randomized
name of column on geodataframe that holds the group total (for use with single group indices)
name of column on geodataframe that holds the total population for each unit (for use with single group indices)
list of columns on input dataframe that hold total population counts for each group of interest
geodataframe with evenly distributed population groups
Simulates the random allocation of groups, given the total population of each geographic unit (randomizes group totals for each location). Given the total population of each location, take draws from a multinomial distribution to assign group categories for each person, where the probability of each group is equal to its regional share. Results are guaranteed to match local population totals, but will include variation in the regional totals for each group