pyhctsa.operations.distribution.custom_skewness

pyhctsa.operations.distribution.custom_skewness(y, what_skew='pearson')

Compute custom skewness measures of a time series.

Calculates either the Pearson skewness or the Bowley (quartile) skewness coefficient.

The Pearson skewness is defined as

\[\frac{3(\mu - \tilde{x})}{\sigma},\]

where \(\mu\) is the mean, \(\tilde{x}\) is the median, and \(\sigma\) is the standard deviation.

The Bowley skewness is defined as

\[\frac{Q_3 + Q_1 - 2Q_2}{Q_3 - Q_1},\]

where \(Q_1\), \(Q_2\), and \(Q_3\) are the first, second (median), and third quartiles, respectively.

Parameters:
y : array-like

Input time series.

what_skew : str, optional

Skewness measure to compute.

  • "pearson": Pearson skewness coefficient.

  • "bowley": Bowley (quartile) skewness coefficient.

Default is "pearson".

Returns:

The calculated skewness value.

  • Positive values indicate right skew.

  • Negative values indicate left skew.

  • Zero indicates symmetry.

Return type:

float