incline.LocalPolynomial¶
- class incline.LocalPolynomial(bandwidth=0.2, degree=2, kernel='gaussian')[source]¶
Local polynomial regression with kernel weights.
Fits a weighted least squares polynomial around every point and reads the derivative off the coefficients.
- Variables:
- Parameters:
- __init__(bandwidth=0.2, degree=2, kernel='gaussian')¶
Methods
__init__([bandwidth, degree, kernel])analytic_operators(axis, order)Emit the operator rows from the same weighted least squares solve.
evaluate(axis, y, order)Fit a weighted local polynomial at every point.
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 bandwidth, degree and kernel.
scale_of(axis)Bandwidth as a fraction of the span.
with_scale(scale, axis)Set the kernel bandwidth to
scaleof the span.Attributes
has_native_posterioris_linearWhether the derivative is a fixed linear map of the data.
requires_regular_gridsupported_orders- analytic_operators(axis, order)[source]¶
Emit the operator rows from the same weighted least squares solve.
Each point’s estimate is
e_k' (X'WX)^-1 X'W y; the row vector in front ofyis that point’s operator row. Building it costs one extra solve against an identity block rather than n full evaluations.