Jump to content

Polynomial regression: Difference between revisions

GP -- thanks to Bill Allombert for pointing out polinterpolate
(Added the Common Lisp implementation.)
(GP -- thanks to Bill Allombert for pointing out polinterpolate)
Line 521:
y = [1, 6, 17, 34, 57, 86, 121, 162, 209, 262, 321];
coeffs = polyfit(x, y, 2)</lang>
 
=={{header|PARI/GP}}==
<lang parigp>polinterpolate([0,1,2,3,4,5,6,7,8,9,10],[1,6,17,34,57,86,121,162,209,262,321])</lang>
Output:
<pre>3*x^2 + 2*x + 1</pre>
 
=={{header|Python}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.