The polynomial_regression command finds a more general polynomial y=a0xn+⋯+an which best fits a set of data points.
polynomial_regression([[1,1],[2,2],[3,10],[4,20]],3) |
or:
polynomial_regression([1,2,3,4],[1,2,10,20],3) |
|
so the best fit polynomial will be y=(−5/6)x3+(17/2)x2 − (56/3)x+12.
The polynomial_regression_plot command draws the best fit polynomial.
polynomial_regression_plot([1,2,3,4],[1,2,10,20],3) |