skewness

Computes the skewness of the values in this iterable.

Skewness measures the asymmetry of a distribution. A positive value indicates a longer right tail, a negative value indicates a longer left tail, and zero indicates symmetry. Uses a two-pass algorithm with z-normalization for numerical stability: first computes the mean and variance via Welford's method, then accumulates normalized cubed deviations.

NaN values propagate through the computation (IEEE 754 semantics): if any element is NaN, the result is NaN. Filter NaN values before calling this function if that is not desired.

Example:

listOf(2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0).skewness() // 0.656...

Return

the skewness, or 0.0 if variance is zero (constant data).

Parameters

kind

whether to compute sample-adjusted (Fisher-Pearson) or population skewness. Defaults to PopulationKind.SAMPLE, which applies the bias correction factor sqrt(n*(n-1)) / (n-2).


Computes the skewness of the values in this array.

Skewness measures the asymmetry of a distribution. A positive value indicates a longer right tail, a negative value indicates a longer left tail, and zero indicates symmetry.

NaN values propagate through the computation (IEEE 754 semantics): if any element is NaN, the result is NaN. Filter NaN values before calling this function if that is not desired.

Example:

doubleArrayOf(2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0).skewness() // 0.656...

Return

the skewness, or 0.0 if variance is zero (constant data).

Parameters

kind

whether to compute sample-adjusted (Fisher-Pearson) or population skewness. Defaults to PopulationKind.SAMPLE, which applies the bias correction factor sqrt(n*(n-1)) / (n-2).


Computes the skewness of the values in this sequence.

The sequence is materialized internally. See DoubleArray.skewness for details.

Return

the skewness, or 0.0 if variance is zero (constant data).

Parameters

kind

whether to compute sample-adjusted or population skewness. Defaults to PopulationKind.SAMPLE.