| Title: | High-Performance LOWESS Smoothing for R |
|---|---|
| Description: | Provides high-performance LOWESS smoothing (Locally Weighted Scatterplot Smoothing) using a 'Rust' backend. Supports various weight functions, robustness iterations, streaming/online processing, cross-validation, and uncertainty quantification. Applicable to genomic data, time series, and general-purpose smoothing tasks. |
| Authors: | Amir Valizadeh [aut, cre, fnd] (ORCID: <https://orcid.org/0000-0001-5983-8527>) |
| Maintainer: | Amir Valizadeh <[email protected]> |
| License: | MIT + file LICENSE | Apache License (== 2.0) |
| Version: | 1.3.0 |
| Built: | 2026-05-13 09:44:45 UTC |
| Source: | https://github.com/thisisamirv/lowess-project |
A high-performance LOWESS (Locally Weighted Scatterplot Smoothing)
implementation built on the Rust fastLowess crate.
Lowess: Primary interface for batch processing
StreamingLowess: Chunked processing for large
datasets
OnlineLowess: Sliding window for real-time data
For comprehensive documentation, tutorials, and API reference, see: https://lowess.readthedocs.io/
Maintainer: Amir Valizadeh [email protected] (ORCID) [funder]
Authors:
Amir Valizadeh [email protected] (ORCID) [funder]
Useful links:
Report bugs at https://github.com/thisisamirv/lowess-project/issues
# Basic smoothing x <- seq(1, 10, length.out = 100) y <- sin(x) + rnorm(100, sd = 0.2) model <- Lowess(fraction = 0.3) result <- model$fit(x, y) plot(x, y) lines(result$x, result$y, col = "red", lwd = 2)# Basic smoothing x <- seq(1, 10, length.out = 100) y <- sin(x) + rnorm(100, sd = 0.2) model <- Lowess(fraction = 0.3) result <- model$fit(x, y) plot(x, y) lines(result$x, result$y, col = "red", lwd = 2)
Create a stateful LOWESS model for batch smoothing.
Lowess( fraction = 0.67, iterations = 3L, delta = NULL, weight_function = "tricube", robustness_method = "bisquare", scaling_method = "mad", boundary_policy = "extend", confidence_intervals = NULL, prediction_intervals = NULL, return_diagnostics = FALSE, return_residuals = FALSE, return_robustness_weights = FALSE, zero_weight_fallback = "use_local_mean", auto_converge = NULL, cv_fractions = NULL, cv_method = "kfold", cv_k = 5L, parallel = TRUE )Lowess( fraction = 0.67, iterations = 3L, delta = NULL, weight_function = "tricube", robustness_method = "bisquare", scaling_method = "mad", boundary_policy = "extend", confidence_intervals = NULL, prediction_intervals = NULL, return_diagnostics = FALSE, return_residuals = FALSE, return_robustness_weights = FALSE, zero_weight_fallback = "use_local_mean", auto_converge = NULL, cv_fractions = NULL, cv_method = "kfold", cv_k = 5L, parallel = TRUE )
fraction |
Smoothing fraction (0 to 1). Default: 0.67. |
iterations |
Robustness iterations. Default: 3. |
delta |
Interpolation threshold. NULL = auto. |
weight_function |
Kernel name. Default: "tricube". |
robustness_method |
Method: "bisquare", "huber", "talwar". |
scaling_method |
Scale estimation: "mad", "mar". |
boundary_policy |
Edge handling: "extend", "reflect", "zero", "noboundary". |
confidence_intervals |
Confidence level (e.g., 0.95). NULL disables. |
prediction_intervals |
Prediction level (e.g., 0.95). NULL disables. |
return_diagnostics |
Return fit metrics. Default: FALSE. |
return_residuals |
Return residuals. Default: FALSE. |
return_robustness_weights |
Return weights. Default: FALSE. |
zero_weight_fallback |
Fallback: "use_local_mean", "return_original", "return_none". |
auto_converge |
Convergence tolerance. NULL disables. |
cv_fractions |
Fractions for cross-validation. NULL disables. |
cv_method |
CV method: "kfold", "loocv". |
cv_k |
Folds for k-fold CV. Default: 5. |
parallel |
Enable parallel processing. Default: TRUE. |
A Lowess object.
x <- seq(0, 10, length.out = 100) y <- sin(x) + rnorm(100, 0, 0.1) model <- Lowess(fraction = 0.2) result <- model$fit(x, y) plot(x, y) lines(x, result$y, col = "red")x <- seq(0, 10, length.out = 100) y <- sin(x) + rnorm(100, 0, 0.1) model <- Lowess(fraction = 0.2) result <- model$fit(x, y) plot(x, y) lines(x, result$y, col = "red")
Wraps a value to be passed to Rust as an Option.
Nullable(x)Nullable(x)
x |
Value to wrap or NULL. |
The value itself. This is a helper for rextendr conversion.
Nullable(5) Nullable(NULL)Nullable(5) Nullable(NULL)
Create a stateful LOWESS model for real-time online data.
OnlineLowess( fraction = 0.2, window_capacity = 100L, min_points = 2L, iterations = 3L, delta = NULL, weight_function = "tricube", robustness_method = "bisquare", scaling_method = "mad", boundary_policy = "extend", update_mode = "incremental", auto_converge = NULL, return_robustness_weights = FALSE, parallel = FALSE )OnlineLowess( fraction = 0.2, window_capacity = 100L, min_points = 2L, iterations = 3L, delta = NULL, weight_function = "tricube", robustness_method = "bisquare", scaling_method = "mad", boundary_policy = "extend", update_mode = "incremental", auto_converge = NULL, return_robustness_weights = FALSE, parallel = FALSE )
fraction |
Smoothing fraction (0 to 1). Default: 0.67. |
window_capacity |
Max points in sliding window. |
min_points |
Minimum points before smoothing. |
iterations |
Robustness iterations. Default: 3. |
delta |
Interpolation threshold. NULL = auto. |
weight_function |
Kernel name. Default: "tricube". |
robustness_method |
Method: "bisquare", "huber", "talwar". |
scaling_method |
Scale estimation: "mad", "mar". |
boundary_policy |
Edge handling: "extend", "reflect", "zero", "noboundary". |
update_mode |
Update strategy: "incremental". |
auto_converge |
Convergence tolerance. NULL disables. |
return_robustness_weights |
Return weights. Default: FALSE. |
parallel |
Enable parallel processing. Default: TRUE. |
An OnlineLowess object.
model <- OnlineLowess(fraction = 0.2, window_capacity = 20) x <- 1:50 y <- sin(x * 0.1) + rnorm(50, 0, 0.1) result <- model$add_points(x, y) plot(x, y) lines(x, result$y, col = "red")model <- OnlineLowess(fraction = 0.2, window_capacity = 20) x <- 1:50 y <- sin(x * 0.1) + rnorm(50, 0, 0.1) result <- model$add_points(x, y) plot(x, y) lines(x, result$y, col = "red")
Plot Lowess Result
## S3 method for class 'LowessResult' plot(x, main = "LOWESS Fit", ...)## S3 method for class 'LowessResult' plot(x, main = "LOWESS Fit", ...)
x |
A LowessResult object. |
main |
Plot title. |
... |
Additional arguments passed to plot() and lines(). |
NULL, invisibly. Called for side effects (plotting).
x <- seq(0, 10, length.out = 100) y <- sin(x) + rnorm(100, 0, 0.1) model <- Lowess(fraction = 0.2) res <- model$fit(x, y) plot(res)x <- seq(0, 10, length.out = 100) y <- sin(x) + rnorm(100, 0, 0.1) model <- Lowess(fraction = 0.2) res <- model$fit(x, y) plot(res)
Print Lowess Model
## S3 method for class 'Lowess' print(x, ...)## S3 method for class 'Lowess' print(x, ...)
x |
A Lowess object. |
... |
Additional arguments (ignored). |
The input object x, invisibly.
model <- Lowess(fraction = 0.3) print(model)model <- Lowess(fraction = 0.3) print(model)
Print Lowess Result
## S3 method for class 'LowessResult' print(x, ...)## S3 method for class 'LowessResult' print(x, ...)
x |
A LowessResult object. |
... |
Additional arguments (ignored). |
The input object x, invisibly.
x <- seq(0, 10, length.out = 50) y <- sin(x) + rnorm(50, 0, 0.1) model <- Lowess(fraction = 0.3) result <- model$fit(x, y) print(result)x <- seq(0, 10, length.out = 50) y <- sin(x) + rnorm(50, 0, 0.1) model <- Lowess(fraction = 0.3) result <- model$fit(x, y) print(result)
Print OnlineLowess Model
## S3 method for class 'OnlineLowess' print(x, ...)## S3 method for class 'OnlineLowess' print(x, ...)
x |
An OnlineLowess object. |
... |
Additional arguments. |
The input object x, invisibly.
model <- OnlineLowess(fraction = 0.2, window_capacity = 20L) print(model)model <- OnlineLowess(fraction = 0.2, window_capacity = 20L) print(model)
Print StreamingLowess Model
## S3 method for class 'StreamingLowess' print(x, ...)## S3 method for class 'StreamingLowess' print(x, ...)
x |
A StreamingLowess object. |
... |
Additional arguments. |
The input object x, invisibly.
model <- StreamingLowess(fraction = 0.3, chunk_size = 50L) print(model)model <- StreamingLowess(fraction = 0.3, chunk_size = 50L) print(model)
Create a stateful LOWESS model for streaming data.
StreamingLowess( fraction = 0.3, chunk_size = 5000L, overlap = NULL, iterations = 3L, delta = NULL, weight_function = "tricube", robustness_method = "bisquare", scaling_method = "mad", boundary_policy = "extend", auto_converge = NULL, return_diagnostics = FALSE, return_robustness_weights = FALSE, parallel = TRUE )StreamingLowess( fraction = 0.3, chunk_size = 5000L, overlap = NULL, iterations = 3L, delta = NULL, weight_function = "tricube", robustness_method = "bisquare", scaling_method = "mad", boundary_policy = "extend", auto_converge = NULL, return_diagnostics = FALSE, return_robustness_weights = FALSE, parallel = TRUE )
fraction |
Smoothing fraction (0 to 1). Default: 0.67. |
chunk_size |
Points per chunk. |
overlap |
Overlap between chunks. |
iterations |
Robustness iterations. Default: 3. |
delta |
Interpolation threshold. NULL = auto. |
weight_function |
Kernel name. Default: "tricube". |
robustness_method |
Method: "bisquare", "huber", "talwar". |
scaling_method |
Scale estimation: "mad", "mar". |
boundary_policy |
Edge handling: "extend", "reflect", "zero", "noboundary". |
auto_converge |
Convergence tolerance. NULL disables. |
return_diagnostics |
Return fit metrics. Default: FALSE. |
return_robustness_weights |
Return weights. Default: FALSE. |
parallel |
Enable parallel processing. Default: TRUE. |
A StreamingLowess object.
x <- seq(0, 10, length.out = 100) y <- sin(x) + rnorm(100, 0, 0.1) model <- StreamingLowess(fraction = 0.2, chunk_size = 50) res1 <- model$process_chunk(x[1:50], y[1:50]) res2 <- model$process_chunk(x[51:100], y[51:100]) final <- model$finalize()x <- seq(0, 10, length.out = 100) y <- sin(x) + rnorm(100, 0, 0.1) model <- StreamingLowess(fraction = 0.2, chunk_size = 50) res1 <- model$process_chunk(x[1:50], y[1:50]) res2 <- model$process_chunk(x[51:100], y[51:100]) final <- model$finalize()