Polynomial regression: Difference between revisions
Content added Content deleted
m (→{{header|Mathematica}}/{{header|Wolfram Language}}: add WA version) |
|||
Line 1,466: | Line 1,466: | ||
Second version: using built-in "InterpolatingPolynomial" function. |
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> |
<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: |
Result: |
||
<pre>1 + 2x + 3x^2</pre> |
<pre>1 + 2x + 3x^2</pre> |