Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nignatiadis/smoothingsplines.jl
Cubic smoothing splines in Julia.
https://github.com/nignatiadis/smoothingsplines.jl
julia nonparametric-regression
Last synced: 24 days ago
JSON representation
Cubic smoothing splines in Julia.
- Host: GitHub
- URL: https://github.com/nignatiadis/smoothingsplines.jl
- Owner: nignatiadis
- License: other
- Created: 2016-05-31T12:21:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-29T16:48:10.000Z (over 1 year ago)
- Last Synced: 2024-12-10T04:16:30.420Z (25 days ago)
- Topics: julia, nonparametric-regression
- Language: Julia
- Homepage:
- Size: 35.2 KB
- Stars: 34
- Watchers: 8
- Forks: 14
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# SmoothingSplines
[![Build Status](https://github.com/nignatiadis/SmoothingSplines.jl/workflows/CI/badge.svg)](https://github.com/nignatiadis/SmoothingSplines.jl/actions)
[![Coverage](https://codecov.io/gh/nignatiadis/SmoothingSplines.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/nignatiadis/SmoothingSplines.jl)A Julia package for nonparametric regression with Cubic Smoothing Splines. The initial aim is to provide the same functionality as R's `smooth.spline` function and competitive computational performance. The implementation however is completely independent of the R function and based on the algorithm by Reinsch [1], as described in Chapter 2 of [2].
```julia
using SmoothingSplines
using RDatasets
using Gadflycars = dataset("datasets","cars")
X = map(Float64,convert(Array,cars[!,:Speed]))
Y = map(Float64,convert(Array,cars[!,:Dist]))spl = fit(SmoothingSpline, X, Y, 250.0) # λ=250.0
Ypred = predict(spl) # fitted vector
plot(layer(x=X, y=Y, Geom.point),
layer(x=X, y=Ypred, Geom.line, Theme(default_color=colorant"red")))predict(spl, 20.0) #prediction at arbitrary point
```### TODO
* Better docs
* conversion between regularization parameter λ and degrees of freedom
* automatic selection of λ (LOOCV, GCV)
* subsampling of design grid for higher efficiency**References**
[1] Reinsch, Christian H. "Smoothing by spline functions." Numerische mathematik 10.3 (1967): 177-183.
[2] Green, Peter J., and Bernard W. Silverman. Nonparametric regression and generalized linear models: a roughness penalty approach. CRC Press, 1993.