incline.Loess

class incline.Loess(frac=0.3, degree=1, robust=True)[source]

LOESS smoothing, then a local polynomial fit to the smooth.

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 – so it is routed to the bootstrap. Note that robust is the default, matching the usual expectation of LOESS.

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

  • degree (int) – Degree of the polynomial fitted to the smooth.

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

Parameters:
__init__(frac=0.3, degree=1, robust=True)
Parameters:
Return type:

None

Methods

__init__([frac, degree, robust])

analytic_operators(axis, order)

State the smoothing and derivative operators directly, if known.

evaluate(axis, y, order)

Smooth with LOWESS, then differentiate the smooth locally.

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 fraction, degree and robustness.

scale_of(axis)

The LOWESS fraction is already a scale.

with_scale(scale, axis)

Set the LOWESS fraction.

Attributes

degree

frac

has_native_posterior

is_linear

Linear exactly when robust reweighting is disabled.

linear

name

requires_regular_grid

robust

supported_orders

name: ClassVar[str] = 'loess'
frac: float = 0.3
degree: int = 1
robust: bool = True
property is_linear: bool

Linear exactly when robust reweighting is disabled.

evaluate(axis, y, order)[source]

Smooth with LOWESS, then differentiate the smooth locally.

Parameters:
  • axis (TimeAxis)

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

  • 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 fraction, degree and robustness.

Return type:

dict[str, Any]