Previous Up Next

9.2.7  Power regression: power_regression power_regression_plot

The power_regression command finds the graph y=bxm which best fits a set of data points.


Example.
Input:

power_regression([[1,1],[2,4],[3,9],[4,16]])

or:

power_regression([1,2,3,4],[1,4,9,16])

Output:

2.0,1.0

so the best fit (in this case, exact fit) power curve will be y = 1.0 x2.


The power_regression_plot command draws the best fit power function.


Example.
Input:

power_regression_plot([1,2,3,4],[1,4,9,16])

Output:

Note that in this case the R2 value is 1, indicating that the data points fall directly on the curve.


Previous Up Next