Emergent classes
Using the exposure as a measure of interaction between classes, we can aggregate the different categories into classes based on their mutual interaction/repulsion.
Measures
cluster_categories (distribution, exposure)
At each step of the aggregation, we look for the pair
The function returns a linkage matrix that encodes the hierarchical tree. At the
Parameters
distribution
dictionaryTakes a dictionary of dictionaries with
distribution[areal_unit][category] = numberexposure
dictionaryTakes a dictionary dictionary of dictionaries, the result of the exposure function with
exposure[$\alpha$ ][$\beta$ ] = ($E_{\alpha \beta}$ ,$\mathrm{Var}(E_{\alpha \beta})$ )
Output
linkage matrix
Returns a list of lists. See above for the description of the linkage matrix's structure.
uncover_classes (distribution, exposure, ci_factor=10)
The classes are uncovered using the spatial repartition of individuals from different categories, using their relative exposure.
We only aggregate the pair
(
Parameters
distribution
dictionaryTakes a dictionary of dictionaries with
distribution[areal_unit][category] = numberexposure
dictionaryTakes a dictionary dictionary of dictionaries, the result of the exposure function with
exposure[$\alpha$ ][$\beta$ ] = ($E_{\alpha \beta}$ ,$\mathrm{Var}(E_{\alpha \beta})$ )ci_factor
floatNumber of standard deviations over which we consider to have a
$99\%$ confidence interval on the exposure value. The default value$10$ , is the upper bound given by Chebyshev's inequality.
Output
classes
nested listsReturns a list of lists. Each list corresponds to a class with
classes[$i$ ] = [categories in class$i$ ]