/** This tests the least-squares fitting routines in LeastSquares.frink */ use LeastSquares.frink points = [[1,1], [2,3], [3,3], [4,5], [6,4]] // Fit the values to a polynomial of the specified degree ls = LeastSquares.fitDegree[points, 2] println[ls.toMatrix[].formatMatrix[]] symbolicMode[true] println[ls.toExpression[]] println[ls.toArray[]] println["Residual is " + ls.residual[]]