segregation.local.LocalDistortion¶
- class segregation.local.LocalDistortion(data, groups=None, metric='euclidean', network=None, distance_matrix=None, normalize=True, n_seeds=4, **kwargs)[source]¶
Multigroup Local Distortion Coefficients.
- Parameters:
- data
pandas.DataFrameorgeopandas.GeoDataFrame,required dataframe or geodataframe if spatial index holding data for location of interest
- groups
list,required list of columns on dataframe holding population totals for each group
- metric
str(optional; ‘euclidean’bydefault) Distance metric for calculating pairwise distances, Accepts any inputs to scipy.spatial.distance.pdist. Ignored if passing a network or distance matrix
- network: pandarm.Network object (optional; None by default)
A pandarm Network object used to compute distance between observations
- distance_matrix:
numpy array of distances between observations in the dataset
- normalize: bool (optional; False by default)
If True, normalize coefficients by the maximum theoretical segregation value for this dataset
- n_seeds: int (optional; 4 by default)
Number of corner positions used to build the maximally-segregated reference landscape. Raising this tightens the normalization constant at the cost of one extra divergence profile per seed. Ignored when
normalizeis False.
- data
- Attributes:
- statistics
pandas.Series KL Divergence coefficients
- core_data
apandasDataFrame DataFrame that contains the columns used to perform the estimate.
- normalization_constant
floatorNone The maximal-segregation distortion coefficient used to normalize the coefficients, or None when
normalizeis False.
- statistics
Notes
Olteanu et al. (2019): ‘Segregation through the multiscalar lens’. https://doi.org/10.1073/pnas.1900192116
- __init__(data, groups=None, metric='euclidean', network=None, distance_matrix=None, normalize=True, n_seeds=4, **kwargs)[source]¶
Init.
Methods
__init__(data[, groups, metric, network, ...])Init.