Skip to content

bicycle1885/Loess.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loess

Build Status

This is a pure Julia loess implementation, based on the fast kd-tree based approximation described in the original Cleveland, et al papers, implemented in the netlib loess C/Fortran code, and used by many, including in R's loess function.

Synopsis

Loess exports two functions: loess and predict, that train and apply the model, respectively.

using Loess

xs = 10 .* rand(100)
ys = sin.(xs) .+ 0.5 * rand(100)

model = loess(xs, ys)

us = range(extrema(xs)...; step = 0.1)
vs = predict(model, us)

using Gadfly
p = plot(x=xs, y=ys, Geom.point, Guide.xlabel("x"), Guide.ylabel("y"),
         layer(Geom.line, x=us, y=vs))
draw(SVG("loess.svg", 6inch, 3inch), p)

Example Plot

There's also a shortcut in Gadfly to draw these plots:

plot(x=xs, y=ys, Geom.point, Geom.smooth, Guide.xlabel("x"), Guide.ylabel("y"))

Status

Multivariate regression is not yet fully implemented, but most of the parts are already there, and wouldn't require too much additional work.

About

Local regression, so smooooth!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Julia 100.0%