Difference between revisions of "SumSquaredErrors Command"
From GeoGebra Manual
Noel Lambert (talk | contribs) |
m (changed example) |
||
Line 1: | Line 1: | ||
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|statistics}} | <noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|statistics}} | ||
− | ;SumSquaredErrors[ | + | ;SumSquaredErrors[ <List of Points>, <Function> ] |
:Calculates the sum of squared errors, SSE, between the y-values of the points in the list and the function values of the x-values in the list. | :Calculates the sum of squared errors, SSE, between the y-values of the points in the list and the function values of the x-values in the list. | ||
− | :{{example|1= If we have a list of points | + | :{{example|1= If we have a list of points <code><nowiki>L={(1, 2), (3, 5),(2, 2), (5, 2), (5, 5)}</nowiki></code> and have calculated for example: <code>f(x)=FitPoly[L,1]</code> and <code>g(x)=FitPoly[L,2]</code>. <code>SumSquaredErrors[L,f]</code> yields ''9'' and <code>SumSquaredErrors[L,g]</code> yields ''6.99'', and therefore we can see, that ''g(x)'' offers the best fit, in the sense of the least sum of squared errors (Gauss).}} |
Revision as of 08:18, 24 August 2015
- SumSquaredErrors[ <List of Points>, <Function> ]
- Calculates the sum of squared errors, SSE, between the y-values of the points in the list and the function values of the x-values in the list.
- Example: If we have a list of points
L={(1, 2), (3, 5),(2, 2), (5, 2), (5, 5)}
and have calculated for example:f(x)=FitPoly[L,1]
andg(x)=FitPoly[L,2]
.SumSquaredErrors[L,f]
yields 9 andSumSquaredErrors[L,g]
yields 6.99, and therefore we can see, that g(x) offers the best fit, in the sense of the least sum of squared errors (Gauss).