MMath

Methods



linearRegression(x:Array, y:Array):Array


Given a set of points on a grid, linear regression will find the slope and y intercept that best fits the points. This is very useful when calculating trends in data. The first parameter is an array of all the x coordinates. The second parameter is an array of all the y coordinates. The returned data is an array, first containing the slope, secondly containing the y intercept.