pylimma.weighted_lowess

pylimma.weighted_lowess(x, y, weights=None, delta=None, npts=200, span=0.3, iterations=4, output_style='loess')[source]

Weighted LOWESS smoother - R-compatible entry point.

Thin wrapper around loess_fit() that mirrors R limma’s weightedLowess(x, y, ...) argument order and parameter names. Use this when porting R code that calls weightedLowess directly. New Python code should prefer loess_fit().

Parameters:
  • x (array_like) – Predictor and response (R’s argument order - note that loess_fit() takes (y, x)).

  • y (array_like) – Predictor and response (R’s argument order - note that loess_fit() takes (y, x)).

  • weights (array_like, optional) – Per-observation weights.

  • delta (float, optional) – Clustering tolerance for the anchor-point-based smoother. Ignored by the current implementation, which uses the exact (non-clustered) weighted LOWESS algorithm. A warning is emitted if supplied.

  • npts (int, default 200) – Number of anchor points. Ignored by the current implementation for the same reason as delta. A warning is emitted if the caller supplies a non-default value.

  • span (float) – See loess_fit().

  • iterations (int) – See loess_fit().

  • output_style ({"loess", "lowess"}, default "loess") –

    • "loess": return {"fitted", "residuals", "weights", "delta"} in the caller’s original point order (matches R’s loess() / loessFit() output shape and loess_fit()).

    • "lowess": return {"x", "y", "delta"} with both arrays sorted by x ascending (matches R’s lowess() output shape).

Returns:

Schema depends on output_style - see above.

Return type:

dict