using GMT
x = sort(10 .* rand(100))
y = sin.(x) .+ 0.5 * rand(100)
ys = lowess(x, y, span=0.2)
scatter(x, y)
plot!(x, ys, show=true)
Compute the smooth of a scatterplot of y against x using robust locally weighted regression. Input vectors x and y must contain either integers or floats. Parameters span and delta must be of type T, where T <: AbstractFloat. Returns a vector ys; ys[i] is the fitted value at x[i]. To get the smooth plot, ys must be plotted against x.
x::Vector: Abscissas of the points on the scatterplot. x must be ordered.y::Vector: Ordinates of the points in the scatterplot.span: The amount of smoothing.nsteps::Integer: Number of iterations in the robust fit.delta: A nonnegative parameter which may be used to save computations. Default is 0.01 * (maximum(x) - minimum(x)).
This function has multiple methods:
lowess(x::AbstractVector{T}, y::AbstractVector{T}; span, nsteps, delta) where T<:AbstractFloat - lowess.jl:49lowess(mat::Matrix{<:Real}; span, nsteps, delta) - lowess.jl:43lowess(x::AbstractVector{R}, y::AbstractVector{S}; span, nsteps, delta) where {R<:Real, S<:Real} - lowess.jl:38lowess(D::GMTdataset; span, nsteps, delta) - lowess.jl:31