kStatistic
Computes the k-statistic of the given order, the unique symmetric unbiased estimator of the corresponding cumulant.
K-statistics generalize familiar estimators to higher orders: k1 equals the sample mean, k2 equals the sample variance (with Bessel's correction, dividing by n-1), k3 and k4 estimate the third and fourth cumulants respectively. Only orders 1 through 4 are supported, matching scipy's kstat function. Each order requires at least that many data points (e.g. k4 needs n >= 4).
Uses z-normalization for orders 3 and 4 to prevent overflow with large-magnitude data.
Example:
val data = listOf(2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0)
data.kStatistic(1) // 5.0 (sample mean)
data.kStatistic(2) // 4.5714... (sample variance)
data.kStatistic(3) // 8.0
data.kStatistic(4) // 19.6571...Return
the k-statistic of the given order.
Parameters
the k-statistic order, must be 1, 2, 3, or 4.
See also
Computes the k-statistic of the given order, the unique symmetric unbiased estimator of the corresponding cumulant.
K-statistics generalize familiar estimators to higher orders: k1 equals the sample mean, k2 equals the sample variance (with Bessel's correction, dividing by n-1), k3 and k4 estimate the third and fourth cumulants respectively. Only orders 1 through 4 are supported, matching scipy's kstat function. Each order requires at least that many data points (e.g. k4 needs n >= 4).
Uses z-normalization for orders 3 and 4 to prevent overflow with large-magnitude data.
Example:
val data = doubleArrayOf(2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0)
data.kStatistic(1) // 5.0 (sample mean)
data.kStatistic(2) // 4.5714... (sample variance)
data.kStatistic(3) // 8.0
data.kStatistic(4) // 19.6571...Return
the k-statistic of the given order.
Parameters
the k-statistic order, must be 1, 2, 3, or 4.
See also
Computes the k-statistic of the given order, the unique symmetric unbiased estimator of the corresponding cumulant.
K-statistics generalize familiar estimators to higher orders: k1 equals the sample mean, k2 equals the sample variance (with Bessel's correction, dividing by n-1), k3 and k4 estimate the third and fourth cumulants respectively. Only orders 1 through 4 are supported, matching scipy's kstat function. Each order requires at least that many data points (e.g. k4 needs n >= 4).
Uses z-normalization for orders 3 and 4 to prevent overflow with large-magnitude data. The sequence is materialized into a list internally.
Example:
val data = sequenceOf(2.0, 4.0, 4.0, 4.0, 5.0, 5.0, 7.0, 9.0)
data.kStatistic(1) // 5.0 (sample mean)
data.kStatistic(2) // 4.5714... (sample variance)Return
the k-statistic of the given order.
Parameters
the k-statistic order, must be 1, 2, 3, or 4.