osl_dynamics.stats.cluster#

Cluster finding and threshold-free cluster enhancement (TFCE).

Clusters are connected sets of targets whose statistic exceeds a threshold. Target dimensions are of two kinds:

  • Cluster dimensions are connected: neighboring indices along a lattice (e.g. consecutive time points or frequencies), or a user-supplied adjacency (e.g. neighboring parcels).

  • All other dimensions are unconnected: a cluster never spans two indices of such a dimension (e.g. two states), but the maximum cluster statistic is still taken over them.

Attributes#

Classes#

ClusterStructure

How the targets are connected.

Functions#

lattice_adjacency(n)

Adjacency of a 1D lattice: index i is adjacent to i-1 and i+1.

find_clusters(stat, threshold, structure[, tail])

Find clusters of supra-threshold targets.

max_cluster_stat(stat, threshold, structure[, tail])

Largest absolute cluster statistic in a map (0 if no clusters).

cluster_stat_map(stat, threshold, structure[, tail])

Map each target to the absolute statistic of its cluster.

tfce(stat, structure[, tail, start, step, E, H])

Threshold-free cluster enhancement.

max_tfce(stat, structure[, tail])

Largest absolute TFCE value in a map.

Module Contents#

osl_dynamics.stats.cluster.Adjacency[source]#