Docs : Commands : polynomial_regression
Syntax
polynomial_regression(Lst||Mtrx(A),[Lst],Intg(n))
Description
Returns the coefficients (an,...a1,a0) of y=an*x^n+..a1x+a0): it is the best polynomial that approximates the points where the coordinates are the rows of A (or the 2 lists) (n is the 2nd argument).
Example
polynomial_regression([[1.0,1.0],[2.0,4.0],[3.0,9.0],[4.0,16.0]],3) returns [-0.0,1.0,-0.0,0.0]
polynomial_regression — Discussion