lowess-project

LOWESS Project

lowess fastLowess PyPI R-universe npm Julia WASM C++ Go Java
fastlowess (Python) libfastlowess (C++) rfastlowess (R)
CI - Rust CI - Python CI - R CI - Julia CI - Node.js CI - WASM CI - C++ CI - Go CI - Java

One LOWESS to Rule Them All
One LOWESS to Rule Them All

The fastest, most robust, and most feature-complete language-agnostic LOWESS (Locally Weighted Scatterplot Smoothing) implementation for Rust, Python, R, Julia, Node.js, C++, Go, Java, and WebAssembly.

The lowess-project contains a complete ecosystem for LOWESS smoothing:


Installation & Documentation

Currently available for R, Python, Rust, Julia, Node.js, WebAssembly, C++, Go, and Java. See the documentation for your binding/crate below for installation instructions.

Binding / Crate Documentation
lowess (Rust) docs.rs/lowess
fastLowess (Rust) docs.rs/fastLowess
Python lowess.readthedocs.io
R thisisamirv.github.io/lowess-project/r
Julia thisisamirv.github.io/lowess-project/julia
Node.js thisisamirv.github.io/lowess-project/nodejs
WebAssembly thisisamirv.github.io/lowess-project/wasm
C++ thisisamirv.github.io/lowess-project/cpp
Go thisisamirv.github.io/lowess-project/go
Java thisisamirv.github.io/lowess-project/java

GPU Backend

GPU acceleration (wgpu: Vulkan, Metal, DirectX 12, and GLES on Android) is also supported for high-throughput batch smoothing. See the GPU Backend page in the documentation for your binding/crate for details.

LOESS vs. LOWESS

Feature LOESS LOWESS (This Crate)
Polynomial Degree Linear, Quadratic, Cubic, Quartic Linear (Degree 1)
Dimensions Multivariate (n-D support) Univariate (1-D only)
Flexibility High (Distance metrics) Standard
Complexity Higher (Matrix inversion) Lower (Weighted average/slope)

Note: For a LOESS implementation, use loess-project.


Why this package?

Speed

It is on average 200-327x faster than Python's statsmodels.lowess and up to 7.8× faster than base R's stats::lowess on a tested large, wide-window workload. GPU fastLowess first beats CPU-parallel execution at 25K–50K points, depending on smoothing fraction, and reaches 4.7× speedup over parallel fastLowess CPU execution at 1M points in the tested workload. Small workloads can favor CPU because of GPU overhead; results vary by workload and hardware. See the Benchmarks page for details.

For more details on the performance comparison, see the Benchmarks page in the documentation for your binding/crate.

Robustness

This implementation is more robust than R's lowess and Python's statsmodels due to two key design choices:

MAD-Based Scale Estimation:

For robustness weight calculations, this crate uses Median Absolute Deviation (MAD) for scale estimation:

s = median(|r_i - median(r)|)

In contrast, statsmodels and R's lowess uses the median of absolute residuals (MAR):

s = median(|r_i|)

Boundary Padding:

This crate applies a range of different boundary policies at dataset edges:

statsmodels and R's lowess do not apply boundary padding, which can lead to:

Features

A variety of features, supporting a range of use cases:

Feature This package statsmodels R (stats)
Kernel 7 options only Tricube only Tricube
Robustness Weighting 3 options only Huber only Huber
Scale Estimation 2 options only MAR only MAR
Boundary Padding 4 options no padding no padding
Zero Weight Fallback 3 options no no
Auto Convergence yes no no
Online Mode yes no no
Streaming Mode yes no no
Confidence Intervals yes no no
Prediction Intervals yes no no
Cross-Validation 2 options no no
Parallel Execution yes no no
GPU Acceleration yes no no
no-std Support yes no no

Validation

All implementations are numerical twins of R's lowess:

Aspect Status Details
Accuracy ✅ EXACT MATCH Max diff < 1e-12 across all scenarios
Consistency ✅ PERFECT Multiple scenarios pass with strict tolerance
Robustness ✅ VERIFIED Robust smoothing matches R exactly

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for more information.

Changelog

See CHANGELOG.md for a history of changes.

License

Licensed under MIT or Apache-2.0.

Citation

If you use this software in your research, please cite it using the CITATION.cff file or the BibTeX entry below:

@software{lowess_project,
  author = {Valizadeh, Amir},
  title = {LOWESS Project: High-Performance Locally Weighted Scatterplot Smoothing},
  year = {2026},
  url = {https://github.com/thisisamirv/lowess-project},
  license = {MIT OR Apache-2.0}
}