RelationshipBetween#

class rojak.turbulence.analysis.RelationshipBetween(this_feature, other_feature, sum_over_dim='time')[source]#

Abstract base class for computing an association measure between two boolean features

Subclasses implement execute() to compute a specific association measure (e.g. Jaccard index, conditional probability, Matthew’s Correlation Coefficient, odds ratio, or relative risk) between this_feature and other_feature. See RelationshipBetweenFactory for constructing the appropriate subclass from a RelationshipBetweenTypes.

Parameters:
__init__(this_feature, other_feature, sum_over_dim='time')[source]#
Parameters:
  • this_feature (DataArray) – First binary variable

  • other_feature (DataArray) – Second binary variable. Its coordinates must be a subset of this_feature’s.

  • sum_over_dim (str | list[str] | None) – Dimension(s) to sum over when computing the contingency table. Defaults to "time".

Raises:

AssertionError – If this_feature and other_feature are not both boolean, or if other_feature’s coordinates are not a subset of this_feature’s

Return type:

None

Methods

__init__(this_feature, other_feature[, ...])

execute()

Compute the association measure between self._this_feature and self._other_feature, see subclasses