segregation.inference.SingleValueTest

class segregation.inference.SingleValueTest(seg_class, iterations_under_null=500, null_approach='systematic', two_tailed=True, **kwargs)[source]

Perform inference for a single segregation measure

Parameters
seg_classa PySAL segregation object
iterations_under_nullnumber of iterations under null hyphothesis
null_approachargument that specifies which type of null hypothesis the inference will iterate. Please take a look at Notes (1).

“systematic” : assumes that every group has the same probability with restricted conditional probabilities p_0_j = p_1_j = p_j = n_j/n (multinomial distribution). “bootstrap” : generates bootstrap replications of the units with replacement of the same size of the original data. “evenness” : assumes that each spatial unit has the same global probability of drawing elements from the minority group of the fixed total unit population (binomial distribution).

“permutation” : randomly allocates the units over space keeping the original values.

“systematic_permutation” : assumes absence of systematic segregation and randomly allocates the units over space. “even_permutation” : assumes the same global probability of drawning elements from the minority group in each spatial unit and randomly allocates the units over space.

two_tailedboolean. Please take a look at Notes (2).

If True, p_value is two-tailed. Otherwise, it is right one-tailed.

**kwargscustomizable parameters to pass to the segregation measures. Usually they need to be the same input that the seg_class was built.

Notes

1) The different approaches for the null hypothesis affect directly the results of the inference depending on the combination of the index type of seg_class and the null_approach chosen. Therefore, the user needs to be aware of how these approaches are affecting the data generation process of the simulations in order to draw meaningful conclusions. For example, the Modified Dissimilarity (ModifiedDissim) and Modified Gini (ModifiedGiniSeg) indexes, rely exactly on the distance between evenness through sampling which, therefore, the “evenness” value for null approach would not be the most appropriate for these indexes.

  1. The one-tailed p_value attribute might not be appropriate for some measures, as the two-tailed. Therefore, it is better to rely on the est_sim attribute.

Examples

Several examples can be found here https://github.com/pysal/segregation/blob/master/notebooks/inference_wrappers_example.ipynb.

Attributes
p_valuefloat

Pseudo One or Two-Tailed p-value estimated from the simulations

est_simnumpy array

Estimates of the segregation measure under the null hypothesis

statisticfloat

The point estimation of the segregation measure that is under test

Methods

plot([ax])

Plot the Infer_Segregation class

__init__(seg_class, iterations_under_null=500, null_approach='systematic', two_tailed=True, **kwargs)[source]

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

Methods

__init__(seg_class[, iterations_under_null, …])

Initialize self.

plot([ax])

Plot the Infer_Segregation class