incline.Loess

class incline.Loess(span=0.3, robust=True)[source]

Local-linear LOWESS smoothing and numerical differentiation.

Linear only when robust is off. The robust variant reweights according to the residuals it just computed, which makes the map depend on the data and routes uncertainty to the bootstrap. The implementation delegates the smooth to statsmodels’ reference LOWESS implementation, which is local linear, then differentiates the returned smooth on its actual time axis.

Variables:
  • span (float) – Fraction of the sample in each local regression.

  • robust (bool) – Whether to run LOWESS’s robustifying iterations.

Parameters:

Note

LOWESS is due to William S. Cleveland (1979), https://doi.org/10.1080/01621459.1979.10481038. The smooth is computed by statsmodels.nonparametric.smoothers_lowess.lowess().

__init__(span=0.3, robust=True)
Parameters:
Return type:

None

Methods

__init__([span, robust])

analytic_operators(axis, derivative_order)

State the smoothing and derivative operators directly, if known.

bootstrap_uncertainty(estimate, axis, y, ...)

Bootstrap a nonlinear smoother, preserving short-range dependence.

evaluate(axis, y, derivative_order)

Smooth with LOWESS, then differentiate the returned curve.

evaluate_with_noise(axis, y, ...)

Evaluate, allowing an adaptive smoother to use a fitted covariance.

fit(axis, y[, derivative_order, ...])

Estimate the trend and, optionally, its uncertainty.

native_posterior(axis, y, derivative_order, ...)

Uncertainty from the smoother's own probability model.

operators(axis, derivative_order)

The smoothing and derivative operators for this configuration.

params()

Report span and robustness.

scale_of(axis)

The LOWESS fraction is already a scale.

with_scale(scale, axis)

Set the LOWESS fraction.

Attributes

has_native_posterior

is_linear

Linear exactly when robust reweighting is disabled.

linear

name

requires_regular_grid

robust

span

supported_orders

uses_noise_for_fit

Whether a supplied noise model can change the point estimate.

name: ClassVar[str] = 'loess'
supported_orders: ClassVar[frozenset[int]] = frozenset({0, 1})
span: float = 0.3
robust: bool = True
property is_linear: bool

Linear exactly when robust reweighting is disabled.

evaluate(axis, y, derivative_order)[source]

Smooth with LOWESS, then differentiate the returned curve.

Parameters:
  • axis (TimeAxis)

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

  • derivative_order (int)

Return type:

Evaluation

with_scale(scale, axis)[source]

Set the LOWESS fraction.

Parameters:
Return type:

Self

scale_of(axis)[source]

The LOWESS fraction is already a scale.

Parameters:

axis (TimeAxis)

Return type:

float

params()[source]

Report span and robustness.

Return type:

dict[str, Any]