Polarisation#

Identifying a population as polarised depends on a measure of polarisation as there are many different notions of “polarisation” ([Bramson2016]). taupy implements many of the measures identified by Bramson et al., but in a definition that is adapted to the belief systems in the theory of dialectical structures.

Measures without clustering#

taupy.analysis.polarisation.spread(positions, measure)[source]#

Returns the maximum distance between any two of the positions relative to a measure (originally defined in [Bramson2016], p. 80–111).

taupy.analysis.polarisation.pairwise_dispersion(positions, measure)[source]#

Returns dispersion, understood as the standard deviation of pairwise distances between the positions relative to the measure. This measure was defined in [Bramson2016].

This is the TDS equivalent of statistical dispersion or variance in polling data. Beside standard deviation, there are other ways of measuring dispersion.

Bramson et al. take the dispersion relative to a mean. However, since such a mean is not well-defined in TDS, we use dispersion on pairwise relations instead.

For this purpose, we use the upper triangle of the difference matrix, without the diagonal zeroes (this offset is controlled by k=1). Since \(D_{a,b} = D_{b,a}\), these are the pairwise difference values we are after. We then take the standard deviation of these values.

Meaures with clustering#

taupy.analysis.polarisation.group_divergence(clusters, adjacency_matrix)[source]#

A variant of Bramson et al.’s group divergence ([Bramson2016]), adapted to belief systems in the theory of dialectical structures.

Group divergence relies on a useful clustering that returns clusters, which is expected to be a list of lists. The adjacency_matrix can be a modified or scaled version of difference_matrix(), or the verbatim matrix.

Algorithms which are known to being able to return good results in TDS are:

  • Leiden (implementation from python-igraph) and other modularity maximisation approaches.

  • Affinity propagation (implementation from scikit-learn).

  • Agglomerative clustering (implementation from scikit-learn).

taupy.analysis.polarisation.group_consensus(clusters, adjacency_matrix)[source]#

A variant of Bramson et al.’s measure of group consensus ([Bramson2016]), adapted to belief systems in the theory of dialectical structures.

As group_divergence(), this relies on a good clustering as well. Arguments and recommentations for algorithms to try are the same as in group_divergence().

taupy.analysis.polarisation.group_size_parity(clusters)[source]#

Bramson et al.’s ([Bramson2016]) measure of (group) size parity, adjusted to belief systems in the theory of dialectical structures. According to the authors, size parity is an entropy measure, which is irrespective of the size of the population and of the number of groups. It is said to behave erratically in case the groups are determined endogenously, e.g. by one of the clustering algorithms Leiden, Affinity propagation, etc.

taupy.analysis.polarisation.coverage_of_clustering(clusters, *, noise_value=- 1)[source]#

The amount of agents fitted into a cluster by algorithms with noise. Examples for such algorithms are OPTICS and DBSCAN from sklearn.

Algorithms that do not allow noise will always return a coverage of 1.

Non-clustered nodes are marked by -1 by convention.