Metadata-Version: 2.1
Name: rsklpr
Version: 0.5.0
Summary: Implementation of the Robust Local Polynomial Regression with Similarity Kernel draft paper
Home-page: https://github.com/yaniv-shulman/rsklpr
License: GPL-3.0-only
Keywords: statistics,robust statistics,regression,robust regression,local polynomial regression,machine learning
Author: Yaniv Shulman
Author-email: yaniv@aleph-zero.info
Requires-Python: >=3.8.0
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Dist: numpy (>=1.24.0)
Requires-Dist: scikit-learn (>=1.3.0)
Requires-Dist: statsmodels (>=0.14.0)
Project-URL: Repository, https://github.com/yaniv-shulman/rsklpr
Description-Content-Type: text/markdown

# Robust Local Polynomial Regression with Similarity Kernels #

## TL;DR ##
This library is useful to perform regression when:
1. There are no particular assumptions on the underlying function except that it is "reasonably smooth". In particular,
you don't know which parametric model to specify or if an appropriate model exists. 
1. There are no particular assumptions on the type and intensity of noise present.
1. There are no particular assumptions on the presence of outliers and their extent.
1. You may want to predict in locations not explicitly present in the dataset but also not too far from existing
observations or far outside the areas where observations exist. 
1. The independent inputs are univariate or multivariate.
1. The dependent variable is univariate.
1. You want a straightforward hassle-free way to tune the model and the smoothness of fit.
1. You may want to calculate confidence intervals.

If the above use cases hold then this library could be useful for you. Have a look at this notebook
https://nbviewer.org/github/yaniv-shulman/rsklpr/tree/main/docs/usage.ipynb for an example of how to use
this library to perform regression easily.

## Installation ##
Install from [PyPI](https://pypi.org/project/rsklpr/) using pip (preferred method):
```bash
pip install rsklpr
```

## Details ##
Local polynomial regression (LPR) is a powerful and flexible statistical technique that has gained increasing popularity
in recent years due to its ability to model complex relationships between variables. Local polynomial regression
generalizes the polynomial regression and moving average methods by fitting a low-degree polynomial to a nearest
neighbors subset of the data at the location. The polynomial is fitted using weighted ordinary least squares, giving
more weight to nearby points and less weight to points further away. Local polynomial regression is however susceptible
to outliers and high leverage points which may cause an adverse impact on the estimation accuracy. This library 
implements a variant of LPR presented in the 
[Robust Local Polynomial Regression with Similarity Kernels draft paper](https://github.com/yaniv-shulman/rsklpr/tree/main/paper/rsklpr.pdf) which uses a generalized similarity kernel
that assign robust weights to mitigate the adverse effect of outliers in the local neighborhood by estimating and
utilizing the density at the local locations. 


### Experimental results ###
The experimental results and demonstration of the library for various experimental settings are available as interactive
Jupyter notebooks at https://nbviewer.org/github/yaniv-shulman/rsklpr/tree/main/src/experiments/


## Contribution and feedback ##
The paper is work in progress and the library in early stages of development but both are in a useful state.
Contributions and feedback are most welcome both to the paper and the code. Please see
[CONTRIBUTE.md](https://github.com/yaniv-shulman/rsklpr/tree/main/CONTRIBUTE.md) for further details.

