org.apache.commons.math3.fitting.leastsquares

## Class LeastSquaresBuilder

- java.lang.Object
- - org.apache.commons.math3.fitting.leastsquares.LeastSquaresBuilder

-     public class LeastSquaresBuilder
      extends Object

  A mutable builder for `LeastSquaresProblem`s.
  Since:
    3.3
  See Also:
    `LeastSquaresFactory`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LeastSquaresBuilder()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `LeastSquaresProblem` | `build()` Construct a `LeastSquaresProblem` from the data in this builder.
    `LeastSquaresBuilder` | `checker(ConvergenceChecker<LeastSquaresProblem.Evaluation> newChecker)` Configure the convergence checker.
    `LeastSquaresBuilder` | `checkerPair(ConvergenceChecker<PointVectorValuePair> newChecker)` Configure the convergence checker.
    `LeastSquaresBuilder` | `lazyEvaluation(boolean newValue)` Configure whether evaluation will be lazy or not.
    `LeastSquaresBuilder` | `maxEvaluations(int newMaxEvaluations)` Configure the max evaluations.
    `LeastSquaresBuilder` | `maxIterations(int newMaxIterations)` Configure the max iterations.
    `LeastSquaresBuilder` | `model(MultivariateJacobianFunction newModel)` Configure the model function.
    `LeastSquaresBuilder` | `model(MultivariateVectorFunction value, MultivariateMatrixFunction jacobian)` Configure the model function.
    `LeastSquaresBuilder` | `parameterValidator(ParameterValidator newValidator)` Configure the validator of the model parameters.
    `LeastSquaresBuilder` | `start(double[] newStart)` Configure the initial guess.
    `LeastSquaresBuilder` | `start(RealVector newStart)` Configure the initial guess.
    `LeastSquaresBuilder` | `target(double[] newTarget)` Configure the observed data.
    `LeastSquaresBuilder` | `target(RealVector newTarget)` Configure the observed data.
    `LeastSquaresBuilder` | `weight(RealMatrix newWeight)` Configure the weight matrix.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LeastSquaresBuilder

          public LeastSquaresBuilder()

  - ### Method Detail

    - #### build

          public LeastSquaresProblem build()

      Construct a `LeastSquaresProblem` from the data in this builder.
      Returns:
        a new `LeastSquaresProblem`.

    - #### maxEvaluations

          public LeastSquaresBuilder maxEvaluations(int newMaxEvaluations)

      Configure the max evaluations.
      Parameters:
        `newMaxEvaluations` - the maximum number of evaluations permitted.
      Returns:
        this

    - #### maxIterations

          public LeastSquaresBuilder maxIterations(int newMaxIterations)

      Configure the max iterations.
      Parameters:
        `newMaxIterations` - the maximum number of iterations permitted.
      Returns:
        this

    - #### checker

          public LeastSquaresBuilder checker(ConvergenceChecker<LeastSquaresProblem.Evaluation> newChecker)

      Configure the convergence checker.
      Parameters:
        `newChecker` - the convergence checker.
      Returns:
        this

    - #### checkerPair

          public LeastSquaresBuilder checkerPair(ConvergenceChecker<PointVectorValuePair> newChecker)

      Configure the convergence checker.

      This function is an overloaded version of `checker(ConvergenceChecker)`.
      Parameters:
        `newChecker` - the convergence checker.
      Returns:
        this

    - #### model

          public LeastSquaresBuilder model(MultivariateVectorFunction value,
                                  MultivariateMatrixFunction jacobian)

      Configure the model function.
      Parameters:
        `value` - the model function value
        `jacobian` - the Jacobian of `value`
      Returns:
        this

    - #### model

          public LeastSquaresBuilder model(MultivariateJacobianFunction newModel)

      Configure the model function.
      Parameters:
        `newModel` - the model function value and Jacobian
      Returns:
        this

    - #### target

          public LeastSquaresBuilder target(RealVector newTarget)

      Configure the observed data.
      Parameters:
        `newTarget` - the observed data.
      Returns:
        this

    - #### target

          public LeastSquaresBuilder target(double[] newTarget)

      Configure the observed data.
      Parameters:
        `newTarget` - the observed data.
      Returns:
        this

    - #### start

          public LeastSquaresBuilder start(RealVector newStart)

      Configure the initial guess.
      Parameters:
        `newStart` - the initial guess.
      Returns:
        this

    - #### start

          public LeastSquaresBuilder start(double[] newStart)

      Configure the initial guess.
      Parameters:
        `newStart` - the initial guess.
      Returns:
        this

    - #### weight

          public LeastSquaresBuilder weight(RealMatrix newWeight)

      Configure the weight matrix.
      Parameters:
        `newWeight` - the weight matrix
      Returns:
        this

    - #### lazyEvaluation

          public LeastSquaresBuilder lazyEvaluation(boolean newValue)

      Configure whether evaluation will be lazy or not.
      Parameters:
        `newValue` - Whether to perform lazy evaluation.
      Returns:
        this object.
      Since:
        3.4

    - #### parameterValidator

          public LeastSquaresBuilder parameterValidator(ParameterValidator newValidator)

      Configure the validator of the model parameters.
      Parameters:
        `newValidator` - Parameter validator.
      Returns:
        this object.
      Since:
        3.4

Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.