segregation.local.LocalRelativeCentralization

class segregation.local.LocalRelativeCentralization(data, group_pop_var, total_pop_var, k_neigh=5)[source]

Calculation of Local Relative Centralization index for each unit

Parameters
dataa geopandas DataFrame with a geometry column.
group_pop_varstring

The name of variable in data that contains the population size of the group of interest

total_pop_varstring

The name of variable in data that contains the total population of the unit

k_neighinteger greater than 0. Default is 5.

Number of assumed neighbors for local context (it uses k-nearest algorithm method)

Returns
statisticsnp.array(n)

Local Relative Centralization values for each unit

core_dataa pandas DataFrame

A pandas DataFrame that contains the columns used to perform the estimate.

Notes

Based on Folch, David C., and Sergio J. Rey. “The centralization index: A measure of local spatial segregation.” Papers in Regional Science 95.3 (2016): 555-576.

Reference: [FR16].

Examples

In this example, we are going to use 2000 Census Tract Data for Sacramento MSA, CA. The group of interest is Black population.

Firstly, we need to perform some import the modules and the respective function.

>>> import libpysal
>>> import geopandas as gpd
>>> from segregation.local import LocalRelativeCentralization

Then, we read the data and create an auxiliary list with only the necessary columns for fitting the index.

>>> input_df = gpd.read_file(libpysal.examples.get_path("sacramentot2.shp"))

The value is estimated below.

>>> index = LocalRelativeCentralization(input_df, 'BLACK_', 'TOT_POP')
>>> index.statistics[0:10] # Values of first 10 units
array([ 0.03443055, -0.29063264, -0.19110976,  0.24978919,  0.01252249,
        0.61152941,  0.78917647,  0.53129412,  0.04436346, -0.20216325])
__init__(data, group_pop_var, total_pop_var, k_neigh=5)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(data, group_pop_var, total_pop_var)

Initialize self.