esda.Spatial_Pearson_Local¶
- class esda.Spatial_Pearson_Local(connectivity=None, permutations=999)[source]¶
Local Spatial Pearson Statistic
Methods
fit(x, y)Bivariate local pearson's R based on Eq.
get_metadata_routing()Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
set_fit_request(*[, x])Request metadata passed to the
fitmethod.set_params(**params)Set the parameters of this estimator.
- fit(x, y)[source]¶
Bivariate local pearson’s R based on Eq. 22 in Lee (2001), using site-wise conditional randomization from Moran_Local_BV.
\[L_i = \dfrac{ n \cdot \Big[ig(\sum_i w_{ij}(x_j - ar{x})ig) ig(\sum_i w_{ij}(y_j - ar{y})ig) \Big] } { \sqrt{\sum_i (x_i - ar{x})^2} \sqrt{\sum_i (y_i - ar{y})^2}} = \dfrac{ n \cdot ( ilde{x}_j - ar{x}) ( ilde{y}_j - ar{y}) } { \sqrt{\sum_i (x_i - ar{x})^2} \sqrt{\sum_i (y_i - ar{y})^2}}\]Lee, Sang Il. (2001), “Developing a bivariate spatial association measure: An integration of Pearson’s r and Moran’s I.” Journal of Geographical Systems, 3(4):369-385.
- Parameters:
- x
numpy.ndarray array containing continuous data
- y
numpy.ndarray array containing continuous data
- x
- Returns:
thefitted estimator.
- set_fit_request(*, x: bool | None | str = '$UNCHANGED$') Spatial_Pearson_Local¶
Request metadata passed to the
fitmethod.Note that this method is only relevant if
enable_metadata_routing=True(seesklearn.set_config()). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True: metadata is requested, and passed tofitif provided. The request is ignored if metadata is not provided.False: metadata is not requested and the meta-estimator will not pass it tofit.None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline. Otherwise it has no effect.