SmoothCurve#

class superglm.SmoothCurve(
x: NDArray,
log_relativity: NDArray,
relativity: NDArray,
level_x: NDArray | None = None,
se_log_relativity: NDArray | None = None,
ci_lower: NDArray | None = None,
ci_upper: NDArray | None = None,
)#

Bases: object

Continuous fitted curve for plotting (not for rating tables).

Attached to TermInference.smooth_curve for features like OrderedCategorical(basis=Spline(...)) where the underlying variable is categorical but a smooth curve is fit through the level midpoints.

x is the curve’s own grid and level_x is marker metadata; NEITHER contains the other. A grouped term expanded back to its original levels puts a marker at every declared level while the curve stays on the axis it was fitted on – the group positions – so a merge at either end of the ordering leaves the curve inside the markers. A consumer that needs both on one canvas should take the union of their extents. The bundled renderers both end up there, by different routes: the matplotlib panel unions the two explicitly, while the plotly one sets no x-range at all and lets autorange cover every trace. Only the first is a guarantee – the second holds as long as nobody adds a range.