Splines

The fitting of splines requires the Interpolations package to be loaded (this explicit requirement was introduced in version 0.6 of EasyFit, and depends on julia >= 1.9).

Use the fitspline function:

using EasyFit, Interpolations, Plots, Random
Random.seed!(1)

x = sort(rand(10))
y = sort(rand(10))

fit = fitspline(x, y)
-------- Spline fit ---------------------------

x spline: x = [0.024094310524527707, 0.025782572017199305, ...]
y spline: y = [0.1149352976286987, 0.12167421651220099, ...]

-----------------------------------------------
scatter(x, y, label="data", framestyle=:box)
plot!(fit.x, fit.y, label="spline", linewidth=2)
Example block output