ScalarExpr
Wire-serialisable AST for scalar expressions over the per-update input environment. The library uses these wherever a stat needs to apply a caller-supplied projection / weight / threshold expression that has to round-trip on the wire; weightBy, transform, the per-bin scaler projections, the WithFeedback op, the loss / pinball / quantile configurations.
The input environment
Every evaluation receives:
x: Double: the primary scalar input. For series stats it's the observation value; for paired stats it's the x-axis; for regression stats it's unused (use V to access feature vector coordinates).y: Double: the secondary scalar input. Used by paired stats (the y-axis) and regression stats (the response).v: DoubleArray: the full input vector. Used by vector / regression stats; empty otherwise.primary: Result?: the primary stat's snapshot at evaluation time for feedback operators. Center, Scale, Low, High read directly from this; per-coordinate ops receive an com.eignex.kumulant.core.IndexedResult to thread the coordinate index through.
Stats that don't need a particular field pass the default (0.0, empty array, null).
Construction
Compose with the DSL operators in this file rather than constructing AST data classes directly: X * 2.0, (X + Const(1.0)) gt 0.0, IfExpr(X gt 0.0, X, -X). The operators return the public sealed interface and hide the concrete (internal) node types.
Wire format
Polymorphic via skema's $type discriminator. The @SerialName on each concrete node is the wire-format tag; pick stable, unambiguous names if you add new ones.
Inheritors
Functions
Build Div of two expressions.
Divide this expression by a literal rhs.
Exact equality (no tolerance).
Exact equality against a literal (no tolerance).
Greater-or-equal comparison.
Greater-or-equal against a literal.
Strictly-greater-than comparison.
Strictly-greater-than against a literal.
Less-or-equal comparison.
Less-or-equal against a literal.
Strictly-less-than comparison.
Strictly-less-than against a literal.
Build Sub of two expressions.
Subtract a literal rhs from this expression.
Build Add of two expressions.
Add a literal rhs to this expression.
Build Mul of two expressions.
Multiply this expression by a literal rhs.
Unary minus: wraps in Neg.