Class LinearRegression

  • All Implemented Interfaces:
    Minimizer.Func

    @Deprecated
    public class LinearRegression
    extends Object
    implements Minimizer.Func
    Deprecated.

    NOTE: DO NOT USE THIS CLASS. IT'S ONLY KEPT FOR REFERENCE. The error term is calculated using the perpendicular distance. This is LESS robust for determining the slope/intercept form of a line than minimizing the vertical distance (i.e. the error in the 'y' term only). because the starting point cannot be rotated through the Y axis. As an example, if the slope of the points is approximately -3.0 and the slope of the starting iteration is 3.0, then RAISING the slope lowers the perpendicular distance. This moves the iterations in the wrong direction.

    This class will do a linear regression by minimizing the squared error between the points provided to the constructor and the line specified by y = m[0]x + m[1]
    • Constructor Detail

      • LinearRegression

        public LinearRegression​(double[] x,
                                double[] y)
        Deprecated.
    • Method Detail

      • func

        public double func​(double[] lineDefMb)
        Deprecated.
        Specified by:
        func in interface Minimizer.Func