CODES = {'empty_distance_class': ('Distance class with no members encountered', 'Decrease the number of distance classes so each one will contain more members'), 'invalid_distance_class_mode': ('Invalid mode for generation of distance classes', 'Must be "equalsized", "linearspaced", or "logspaced" ["logspaced" not yet supported!]'), 'invalid_distance_class_type': ('Invalid distance class type', 'Must be either "circle" or "concentric"')}
performs individual Mantel tests for each of a number of (spatial)
distance classes built from the matrix of spatial distances
spatialDistMatrix.
If mode is set to MANTELCORRELOGRAM_MODE_AUTO, a rather
experimental autocorrelation statistics is computed (a true autocorrelation
[lag one] of the distance class vectors; use e.g. cpca as statistics
parameter in this mode).
Parameters:
spatialDistMatrix: a symmetric matrix of spatial distances between
objects
featureDistMatrix: matrix of feature-induced distances between
objects; must have the same shape as spatialDistMatrix
test: if True, a permutation test for significance of the correlogram
is performed
statistics (only used if test is True): statistics for the
correlogram significance test
numberPermutations (only used if test is True): number of
permutations for the correlogram significance test
correlationFunction (only used with mode set to
MANTELCORRELOGRAM_MODE_AUTO): is used for correlating the average
distance vectors resulting from the individual distance classes
distanceClassOptionD: keyword arguments that are passed on to the
distance_classes function
Value:
list of 4-tuples of results per distance class ::
(<statistics value>,<significance>,<real distance>,<n class members>)
Takes a symmetic pxp distance matrix <D> and returns a list of
numberClasses (<indicator matrix>,<upper bound>,<class size>) tuples with
<indicator matrix>: symmetric binary matrix indicating membership to
the distance class
<upper bound>: upper boundary for distance class
<class size>: number of sample units per class
If bounds is not None, it is taken to be a list of upper boundaries.
Otherwise, the boundaries are computed according to the value of mode,
which can be one of the following:
DISTANCECLASS_MODE_EQUALSIZED: produces classes with equal numbers of
neighborhood relationships (but not necessarily containing equal numbers
of sample units!)
DISTANCECLASS_MODE_EQUALSPACED: produces classes based on linearly
spaced boundaries
DISTANCECLASS_MODE_LOGSPACED: produces classes based on log-spaced
boundaries (not implemented yet!)
kind decides on what type of distance classes is generated:
DISTANCECLASS_KIND_CIRCULAR: includes all neighbors closer than
bounds[i]
DISTANCECLASS_KIND_CONCENTRIC: includes neighbors which are closer than
bounds[i], but farther than bounds[i-1]
performs a CA with spatial weights as shown in Thiououse et al. (1995)
(J Ecol Environ Statist 2: 1-14).
X is the n x p data matrix (non-negative, no zero row/column totals as
in normal CA) and M is the (n x n) matrix of the neighboring graph
(m_ij = 1 if i neighbor of j; also symmetric with no zero row/column
totals).
Returns a 3-tuple
(<total CA results>, <global CA results>, <local CA results>)