getis_ord#
- getis_ord(domain, population, label_name, include_boundaries=None, exclude_boundaries=None, boundary_exclude_distance=0, distance_weight_function=None, network_kwargs={'max_edge_distance': inf, 'min_edge_distance': 0, 'network_type': 'Delaunay'}, alpha=0.05, add_local_value_as_label=True, local_getis_label_name=None)#
Calculate the local Getis-Ord G* statistic for spatial autocorrelation of a continuous label. The Getis-Ord G* statistic is a measure of spatial autocorrelation that identifies hotspots and coldspots in the spatial distribution of a continuous label. The local Getis-Ord G* statistic is calculated for each object in the domain and the z-scores and p-values for each object are returned. Postive z-scores indicate clustering of high values (hotspots) and negative z-scores indicate clustering of low values (coldspots). The p-values are adjusted for multiple comparisons using the Bonferroni procedure. Local Getis-Ord G* values are added as labels to the domain if add_local_value_as_label is True.
- Parameters:
- domainobject
A muspan domain object.
- populationlist or np.ndarray or query-like
The population of objects or a query to select objects.
- label_namestr
The name of the label to be analysed. Must refer to a continuous label, not a categorical one.
- include_boundarieslist, np.ndarray or query-like or None, optional
Boundaries to include or None to include all.
- exclude_boundarieslist, np.ndarray or query-like or None, optional
Boundaries to exclude or None to exclude none.
- boundary_exclude_distancefloat, optional
Distance to exclude around boundaries, default is 0.
- distance_weight_functioncallable or None, optional
Function to weight distances, default f(x) = 1.
- network_kwargsdict, optional
Dictionary of network generation parameters, default is {‘network_type’: ‘Delaunay’, ‘min_edge_distance’: 0, ‘max_edge_distance’: np.inf}.
- alphafloat, optional
Significance level for null rejection, default is 0.05.
- add_local_value_as_labelbool, optional
Whether to add the local Getis-Ord values as labels in the domain. Default is True.
- local_getis_label_namestr, optional
Name for the local Getis-Ord label. If not specified, this will default to ‘Local Getis Ord - {label_name}’, where {label_name} is the label specified above.
- Returns:
- local_getis_ord_zscorenumpy.ndarray
Array of local Getis-Ord z-scores for each object.
- local_getis_ord_pvalsnumpy.ndarray
Array of adjusted p-values for each object.
- object_indicesnumpy.ndarray
Array of object indices used in the analysis.
- Raises:
- ValueError
If the label does not exist or is not continuous, or if the distance_weight_function is not callable.
- Warnings
- UserWarning
If the number of objects is less than 30, indicating potential issues with statistical validity.
Notes
For more information, see https://doi.org/10.1111/j.1538-4632.1992.tb00261.x.