Polynomial regression: Difference between revisions

m
Line 1,466:
Second version: using built-in "InterpolatingPolynomial" function.
<syntaxhighlight lang="mathematica">Simplify@InterpolatingPolynomial[{{0, 1}, {1, 6}, {2, 17}, {3, 34}, {4, 57}, {5, 86}, {6, 121}, {7, 162}, {8, 209}, {9, 262}, {10, 321}}, x]</syntaxhighlight>
WolframAlpha version:
<syntaxhighlight lang="mathematica">curve fit (0,1), (1,6), (2,17), (3,34), (4,57), (5,86), (6,121), (7,162), (8,209), (9,262), (10,321)</syntaxhighlight>
Result:
<pre>1 + 2x + 3x^2</pre>
23

edits