esda.Spatial_Pearson¶
-
class esda.Spatial_Pearson(connectivity=
None, permutations=999)[source]¶ Global Spatial Pearson Statistic
Initialize a spatial pearson estimator
- Parameters:¶
- association_[source]¶
array containg the estimated Lee spatial pearson correlation coefficients, where element [0,1] is the spatial correlation coefficient, and elements [0,0] and [1,1] are the “spatial smoothing factor”
- Type:¶
numpy.ndarray (2,2)
- reference_distribution_[source]¶
distribution of correlation matrices for randomly-shuffled maps.
- Type:¶
numpy.ndarray (n_permutations, 2,2)
- significance_[source]¶
permutation-based p-values for the fraction of times the observed correlation was more extreme than the simulated correlations.
- Type:¶
numpy.ndarray (2,2)
Methods
fit(x, y)bivariate spatial pearson's R based on Eq.
Get metadata routing of this object.
get_params([deep])Get parameters for this estimator.
set_fit_request(*[, x])Configure whether metadata should be requested to be passed to the
fitmethod.set_params(**params)Set the parameters of this estimator.
- fit(x, y)[source]¶
bivariate spatial pearson’s R based on Eq. 18 of [Lee, 2001].
L = dfrac{Z^T (V^TV) Z}{1^T (V^TV) 1}
Notes
Technical details and derivations can be found in [Lee, 2001].
- get_metadata_routing()[source]¶
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:¶
routing – A
MetadataRequestencapsulating routing information.- Return type:¶
MetadataRequest
-
set_fit_request(*, x=
'$UNCHANGED$')[source]¶ Configure whether metadata should be requested to be passed to the
fitmethod.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True(seesklearn.set_config()). Please check the 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.Added in version 1.3.