Giter Site home page Giter Site logo

nonparametricregression.jl's Introduction

NonparametricRegression.jl

lifecycle build codecov.io

This package implements non-parametric regression, also called local regression or kernel regression. Currently the functionality is limited to univariate regressions and to only the local constant (localconstant) and local linear (locallinear,llalphabeta) estimators. Automatic bandwidth selection is done by leave-one-out cross validation or by optimizing the bias-corrected AICc statistic.

The two important exported convenience methods are npregress and optimalbandwidth which abstract from a lot of the implementation detail and allow you to easily switch estimators or bandwidth selection procedures.

Examples

using NonparametricRegression

npregress

Detail

  • Scaled Gaussian kernel (GaussianKernel) by default (aliased by NormalKernel(h) where h is the bandwidth). Other available kernels are UniformKernel and EpanechnikovKernel. Adding a new kernel would be a relatively easy PR, see src/kernels.jl.
  • For local linear estimation, two functions are provided. The first is locallinear which explicitly computes a weighted average of y as in localconstant. The second is llalphabeta which computes (and returns) the intercept and slope terms of the local linear regression, the intercept of which is the expected y. llalphabeta requires only one pass over the data, so is more performant than locallinear because computing the weights requires 2 passes, but the results are identical modulo any small numerical epsilons.
  • Care was taken to make things non-allocating and performant. The package does not use the "binning" technique that other packages use (R's KernSmooth, for example), so on very large datasets there could be a performance loss relative to those packages. The package does not use multithreading, so again some performance gain could be had here if needed. PRs welcome.

Related

KernelDensity.jl is a nice package for doing kernel density estimation.

KernelEstimators.jl is an outdated package which I found after already implementing most of this package. Consider this an updated version I guess.

LOESS.jl is a package implementing a similar but different type of local regression (loess, obviously).

nonparametricregression.jl's People

Contributors

tbeason avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nonparametricregression.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Suggestions

Just noticed your package. Looks promising. Just two suggestions

  1. drop Optim.jl since its a heavy dependency. I believe a simple golden section search should be enough (like 20 lines of code). See how KernelDensity.jl did this.
  2. add standard errors, eg. as in my teaching notebook

Would it be possible to release a new version?

I am not able to install it at the moment because of the compat 0.8 on DocStringExtension clashing with Pigeons' 0.9 requirement. I see that the head of the repo already added 0.9 to its compat. Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.