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.1540131687660296
      b = -0.16684672659378133
      c = 0.0795463708208228

Correlation coefficient, R² = 0.9902462794739332
Average square residue = 0.0007388439233342179

Predicted Y: ypred = [0.07619625993801021, 0.0741324648748413, ...]
residues = [-0.018816101245944836, 0.025609591150666612, ...]

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