incline.InterpolatingSpline

class incline.InterpolatingSpline(function_order=3, s=None, s_factor=1.0)[source]

Smoothing spline that chooses its own knots.

UnivariateSpline places knots to satisfy a residual budget, so the fitted map depends on the data and no operator exists – probing it misses by a factor of order one, not by rounding error. Uncertainty comes from the bootstrap.

Variables:
  • function_order (int) – Spline degree.

  • s (float | None) – Residual budget. Derived from the data when None.

Parameters:
__init__(function_order=3, s=None, s_factor=1.0)
Parameters:
Return type:

None

Methods

__init__([function_order, s, s_factor])

analytic_operators(axis, order)

State the smoothing and derivative operators directly, if known.

evaluate(axis, y, order)

Fit the spline and differentiate it.

fit(axis, y[, order, se, noise, ...])

Estimate the trend and, optionally, its uncertainty.

native_posterior(axis, y, order, ...)

Uncertainty from the smoother's own probability model.

operators(axis, order)

The smoothing and derivative operators for this configuration.

params()

Report the spline degree and budget.

scale_of(axis)

Approximate scale implied by the budget multiplier.

with_scale(scale, axis)

Scale the residual budget; larger budget means a smoother fit.

Attributes

function_order

has_native_posterior

is_linear

Whether the derivative is a fixed linear map of the data.

linear

name

requires_regular_grid

s

s_factor

supported_orders

name: ClassVar[str] = 'spline'
supported_orders: ClassVar[frozenset[int]] = frozenset({0, 1, 2, 3})
function_order: int = 3
s: float | None = None
s_factor: float = 1.0
evaluate(axis, y, order)[source]

Fit the spline and differentiate it.

Parameters:
  • axis (TimeAxis)

  • y (npt.NDArray[np.float64])

  • order (int)

Return type:

Evaluation

with_scale(scale, axis)[source]

Scale the residual budget; larger budget means a smoother fit.

Parameters:
Return type:

Self

scale_of(axis)[source]

Approximate scale implied by the budget multiplier.

Parameters:

axis (TimeAxis)

Return type:

float

params()[source]

Report the spline degree and budget.

Return type:

dict[str, Any]