Class LeastSquaresFactory.LocalLeastSquaresProblem

java.lang.Object
org.apache.commons.math3.optim.AbstractOptimizationProblem<LeastSquaresProblem.Evaluation>
org.apache.commons.math3.fitting.leastsquares.LeastSquaresFactory.LocalLeastSquaresProblem
All Implemented Interfaces:
LeastSquaresProblem, OptimizationProblem<LeastSquaresProblem.Evaluation>
Enclosing class:
LeastSquaresFactory

private static class LeastSquaresFactory.LocalLeastSquaresProblem extends AbstractOptimizationProblem<LeastSquaresProblem.Evaluation> implements LeastSquaresProblem
A private, "field" immutable (not "real" immutable) implementation of LeastSquaresProblem.
Since:
3.3
  • Field Details

    • target

      private final RealVector target
      Target values for the model function at optimum.
    • model

      private final MultivariateJacobianFunction model
      Model function.
    • start

      private final RealVector start
      Initial guess.
    • lazyEvaluation

      private final boolean lazyEvaluation
      Whether to use lazy evaluation.
    • paramValidator

      private final ParameterValidator paramValidator
      Model parameters validator.
  • Constructor Details

  • Method Details

    • getObservationSize

      public int getObservationSize()
      Get the number of observations (rows in the Jacobian) in this problem.
      Specified by:
      getObservationSize in interface LeastSquaresProblem
      Returns:
      the number of scalar observations
    • getParameterSize

      public int getParameterSize()
      Get the number of parameters (columns in the Jacobian) in this problem.
      Specified by:
      getParameterSize in interface LeastSquaresProblem
      Returns:
      the number of scalar parameters
    • getStart

      public RealVector getStart()
      Gets the initial guess.
      Specified by:
      getStart in interface LeastSquaresProblem
      Returns:
      the initial guess values.
    • evaluate

      public LeastSquaresProblem.Evaluation evaluate(RealVector point)
      Evaluate the model at the specified point.
      Specified by:
      evaluate in interface LeastSquaresProblem
      Parameters:
      point - the parameter values.
      Returns:
      the model's value and derivative at the given point.