Constrain shapes#

Constraints declared with Constraint.fit are enforced during fitting and need none of this. For spline terms declared with Constraint.postfit, apply_shape_postfit() repairs monotone and curvature constraints by projecting the fitted curve and mapping it back to spline coefficients; monotonize() is the same repair under its original name and is idempotent, and apply_monotone_postfit() is its compatibility alias. The how-to on constraining a smooth walks through both routes.

apply_shape_postfit

Repair postfit monotone and curvature-constrained spline terms.

monotonize

Repair post-fit shape-constrained spline terms after fitting.

apply_monotone_postfit

Compatibility alias for superglm.SuperGLM.monotonize().