Quadratic fit

Use the fitquad (or fitquadratic) function:

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

x = sort(rand(10))
y = x .^ 2 .+ 0.1 * rand(10)

fit = fitquad(x, y)
------------------- Quadratic Fit -------------

Equation: y = ax^2 + bx + c

With: a = 1.1540131685977317
      b = -0.1668467264479345
      c = 0.07954637080735433

Correlation coefficient, R² = 0.9902462794739334
Average square residue = 0.0007388439233342172

Predicted Y: ypred = [0.07619625992795812, 0.07413246486813746, ...]
residues = [-0.018816101255996934, 0.025609591143962766, ...]

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