Fit Command

From GeoGebra Manual
Jump to: navigation, search

Fit( <List of Points>, <List of Functions> )
Calculates a linear combination of the functions that best fit the points in the list.
  • Fit({(-2, 3), (0, 1), (2, 1), (2, 3)}, {x^2, x}) yields 0.625 x^2 - 0.25x.
  • Let L = {A, B, C, ...}, f(x) = 1, g(x) = x, h(x) = e^x, F = {f, g, h}.
    Fit(L, F) calculates a function of the form a + b x + c e^x that fits the points in the list.
Fit( <List of points>, <Function> )
Calculates a minimum squared error function to the points in the list. The function must depend on one or more sliders, that are taken as start values of parameters to be optimized. The non-linear iteration might not converge, but adjusting the sliders to a better starting point might help.
Example: Let a be slider with interval from -5 to 5 and increment 1. Fit({(-2, 3), (0, 1), (2, 1), (2, 3)}, a + x^2) yields -1 + x^2.
Note: Other point fitting commands are FitExp, FitGrowth, FitLine, FitLineX, FitLog, FitLogistic, FitPoly, FitPow and FitSin.
© 2018 International GeoGebra Institute