JuliaStats / Loess.jl

Local regression, so smooooth!
Other
103 stars 34 forks source link

Predictions are not smooth #61

Closed andreasnoack closed 1 year ago

andreasnoack commented 1 year ago

I'd say that the purpose of LOESS is to provide smooth predictions but that is not the case with the current implementation. Compare the LOESS lines produced by this package to the one from R. The tuning parameters should be identical.

Loess.jl:

julia> using Loess, CairoMakie

julia> lf = loess(df.x, df.y);

julia> f, ax, l1 = scatter(df.x, df.y);

julia> lines!(ax, px, Loess.predict(lf, px), color=:black);

julia> f
Skærmbillede 2023-03-16 kl  09 24 28

R:

> df <- read.csv("/Users/andreasnoack/Downloads/loessdf.csv")
> plot(y ~ x, df)
> lf <- loess(y ~ x, df)
> lines(px, predict(lf, px))
Skærmbillede 2023-03-16 kl  10 16 57

Data

loessdf.csv

bjarthur commented 1 year ago

closed by https://github.com/JuliaStats/Loess.jl/pull/63 ?

andreasnoack commented 1 year ago

closed by https://github.com/JuliaStats/Loess.jl/pull/63 ?

Yes!