processCapability
Computes process capability indices (Cp, Cpk, Pp, Ppk) for the Long values.
Values are converted to Double internally. Long values whose absolute value exceeds 2^53 (9,007,199,254,740,992) may lose precision in the least-significant digits.
Example:
val result = listOf(10L, 11L, 9L, 10L, 12L).processCapability(lsl = 5.0, usl = 15.0)
result.cp // 1.43...Return
a ProcessCapabilityResult containing Cp, Cpk, Pp, and Ppk.
Parameters
the lower specification limit. Must be less than usl.
the upper specification limit. Must be greater than lsl.
Throws
if all values are identical (standard deviation is zero).
Computes process capability indices (Cp, Cpk, Pp, Ppk) for the Int values.
Values are converted to Double internally. The conversion is exact for all Int values.
Example:
val result = listOf(10, 11, 9, 10, 12).processCapability(lsl = 5.0, usl = 15.0)
result.cp // 1.43...Return
a ProcessCapabilityResult containing Cp, Cpk, Pp, and Ppk.
Parameters
the lower specification limit. Must be less than usl.
the upper specification limit. Must be greater than lsl.
Throws
if all values are identical (standard deviation is zero).
Computes process capability indices (Cp, Cpk, Pp, Ppk) for the values in this array.
These indices measure whether a manufacturing or business process produces output that fits within specification limits. The lower specification limit lsl and upper specification limit usl define the acceptable range. The indices compare this tolerance width to the observed spread of the data:
Cp = tolerance / (6 × sample σ) — potential capability, ignoring centering.
Cpk = min of the distance from the mean to each spec limit, divided by 3 × sample σ.
Pp and Ppk — same formulas using population σ (divides by n instead of n-1).
Uses Welford's numerically stable single-pass algorithm for mean and variance.
NaN values in the data propagate through the computation (IEEE 754 semantics).
Example:
val data = doubleArrayOf(10.1, 10.3, 9.8, 10.0, 10.2, 9.9, 10.1)
val result = data.processCapability(lsl = 9.0, usl = 11.0)
result.cp // 1.94...
result.cpk // 1.81...Return
a ProcessCapabilityResult containing Cp, Cpk, Pp, and Ppk.
Parameters
the lower specification limit. Must be less than usl.
the upper specification limit. Must be greater than lsl.
Throws
if all values are identical (standard deviation is zero).
Computes process capability indices (Cp, Cpk, Pp, Ppk) for the values in this iterable.
These indices measure whether a process produces output that fits within specification limits defined by lsl (lower) and usl (upper). Values above 1.0 indicate a capable process; values above 1.33 are generally considered good.
NaN values in the data propagate through the computation (IEEE 754 semantics).
Example:
val result = listOf(10.1, 10.3, 9.8, 10.0, 10.2).processCapability(lsl = 9.0, usl = 11.0)
result.cp // 1.68...Return
a ProcessCapabilityResult containing Cp, Cpk, Pp, and Ppk.
Parameters
the lower specification limit. Must be less than usl.
the upper specification limit. Must be greater than lsl.
Throws
if all values are identical (standard deviation is zero).
Computes process capability indices (Cp, Cpk, Pp, Ppk) for the values in this sequence.
These indices measure whether a process produces output that fits within specification limits defined by lsl (lower) and usl (upper). Values above 1.0 indicate a capable process; values above 1.33 are generally considered good.
NaN values in the data propagate through the computation (IEEE 754 semantics).
Example:
val result = sequenceOf(10.1, 10.3, 9.8, 10.0, 10.2).processCapability(lsl = 9.0, usl = 11.0)
result.cpk // 1.57...Return
a ProcessCapabilityResult containing Cp, Cpk, Pp, and Ppk.
Parameters
the lower specification limit. Must be less than usl.
the upper specification limit. Must be greater than lsl.
Throws
if all values are identical (standard deviation is zero).