asymcat.correlation¶
Association between two whole variables, given as aligned series. See Summarise whole variables.
Convenience wrappers for computing association measures on parallel series.
Unlike asymcat.scorer.CatScorer, which returns per-symbol-pair
directional scores from a list of co-occurrences, the helpers in this module
operate on two aligned series (series_x and series_y) and return a
single summary statistic for the pair of variables.
Note that not every measure here is symmetric: cramers_v is symmetric
by definition, whereas conditional_entropy and theil_u are
directional (x given y) and are therefore, in general, asymmetric.
cramers_v ¶
Compute Cramér's V between two aligned series.
Cramér's V is a symmetric measure of association derived from Pearson's chi-square statistic, ranging from 0 (no association) to 1 (perfect association).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
series_x
|
list
|
The first series of observed symbols. |
required |
series_y
|
list
|
The second series of observed symbols, aligned with |
required |
Returns:
| Type | Description |
|---|---|
float
|
Cramér's V for the two series. |
conditional_entropy ¶
Compute the conditional entropy of series_x given series_y.
This is a directional measure: in general, H(x|y) != H(y|x).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
series_x
|
list
|
The series whose entropy (conditioned on |
required |
series_y
|
list
|
The conditioning series, aligned with |
required |
estimator
|
str
|
Entropy estimator: |
'plugin'
|
Returns:
| Type | Description |
|---|---|
float
|
The conditional entropy |
theil_u ¶
Compute Theil's U (uncertainty coefficient) of series_x given series_y.
Theil's U normalizes the reduction in uncertainty of series_x obtained
from knowing series_y by the entropy of series_x, yielding a value
in the [0, 1] range. It is a directional measure and is, in general,
asymmetric (U(x|y) != U(y|x)).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
series_x
|
list
|
The series whose uncertainty is being reduced. |
required |
series_y
|
list
|
The conditioning series, aligned with |
required |
estimator
|
str
|
Entropy estimator: |
'plugin'
|
Returns:
| Type | Description |
|---|---|
float
|
Theil's U for |