case class Trapezoid(a: Double, b: Double) extends Shape
A trapezoidal probability distribution, arising from the convolution of two Box distributions. The flat top has half-width (b-a) and the ramps extend to (a+b). NOTE: unlike Box and Gaussian which are case objects with l passed as a parameter to wiggle, Trapezoid carries its own scale parameters a and b. The l parameter of wiggle and probability is therefore ignored. TODO: at some future point, refactor Box and Gaussian similarly, moving l into the case class/object.
Value parameters
a
the half-width of the smaller of the two constituent Box distributions (a <= b).
b
the half-width of the larger of the two constituent Box distributions.
Computes a value based on the given confidence level. The method distinguishes between two regions: a flat-top region where the result is independent of confidence, and a ramp region where the result depends on confidence. Special cases are handled for confidence values of 0.0 and 1.0. NOTE: the l parameter is ignored since scale is encoded in a and b.
Computes a value based on the given confidence level. The method distinguishes between two regions: a flat-top region where the result is independent of confidence, and a ramp region where the result depends on confidence. Special cases are handled for confidence values of 0.0 and 1.0. NOTE: the l parameter is ignored since scale is encoded in a and b.
Value parameters
confidence
a value between 0.0 and 1.0 representing the level of certainty or probability.
l
a parameter intended for use in computations (currently not utilized).
Attributes
Returns
a computed double value based on the given confidence level.
The standard deviation of this Trapezoid distribution, derived from the sum of variances of the two constituent Box distributions: Var = a²/3 + b²/3 = (a²+b²)/3.
The standard deviation of this Trapezoid distribution, derived from the sum of variances of the two constituent Box distributions: Var = a²/3 + b²/3 = (a²+b²)/3.