Fast nonparametric regression and kernel density estimation using Non-Uniform Fast Fourier Transform (NUFFT) for MATLAB, Python, and R.
- O(N + M log M) complexity - Scales efficiently to large datasets
- Multi-language support - MATLAB (reference), Python, and R implementations
- Flexible regression orders - Local constant (NW), local linear, local quadratic
- Automatic bandwidth selection - GCV for regression, LCV for density estimation
- Complex-valued data support - Handles complex predictors and responses
- Heteroscedastic variance estimation - Estimates conditional variance
cd fastLPR
fastLPR_setupcd fastLPR_py
uv pip install -e .# From CRAN
install.packages("fastlpr")
# Or from source
setwd("fastLPR_R")
source("setup.R")% 1D regression with automatic bandwidth selection
x = rand(500, 1);
y = sin(2*pi*x) + 0.1*randn(500, 1);
hlist = get_hList(20, [0.01, 1], @logspace);
opt.order = 1; % Local linear
regs = cv_fastLPR(x, y, hlist, opt);
fastLPR_plot(regs.fpp_yhat);import numpy as np
from fastlpr import cv_fastlpr, get_hlist
x = np.random.rand(500, 1)
y = np.sin(2*np.pi*x) + 0.1*np.random.randn(500, 1)
hlist = get_hlist(20, [0.01, 1.0])
regs = cv_fastlpr(x, y, hlist, {'order': 1})source("setup.R")
x <- matrix(runif(500), ncol=1)
y <- sin(2*pi*x) + 0.1*rnorm(500)
hlist <- get_hlist(20, c(0.01, 1.0))
regs <- cv_fastlpr(x, y, hlist, list(order=1))- MATLAB: See
fastLPR/README.mdand function help texts - Python: See
fastLPR_py/README.mdand docstrings - R: See
fastLPR_R/README.mdand roxygen2 documentation
Each implementation includes reproducible examples for the JSS paper figures:
fastLPR/example/reproduce_all_figures.m
fastLPR_py/examples/reproduce_all_figures.py
fastLPR_R/inst/examples/reproduce_all_figures.R
If you use fastLPR in your research, please cite:
@article{wang2025fastlpr,
title = {{fastLPR}: Fast Local Polynomial Regression via {NUFFT} in {MATLAB}, {Python}, and {R}},
author = {Wang, Ying and Li, Min and Paz-Linares, Deirel and Valdes-Sosa, Pedro A.},
year = {2025},
note = {Submitted},
url = {https://github.com/rigelfalcon/fastLPR}
}GPL-3.0-or-later. See LICENSE for details.
- Ying Wang (yingwangrigel@gmail.com)
- Min Li (minli.231314@gmail.com)
- Deirel Paz-Linares
- Pedro A. Valdes-Sosa