Class OptimumImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      OptimumImpl​(LeastSquaresProblem.Evaluation value, int evaluations, int iterations)
      Construct an optimum from an evaluation and the values of the counters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getCost()
      Get the cost.
      RealMatrix getCovariances​(double threshold)
      Get the covariance matrix of the optimized parameters.
      int getEvaluations()
      Get the number of times the model was evaluated in order to produce this optimum.
      int getIterations()
      Get the number of times the algorithm iterated in order to produce this optimum.
      RealMatrix getJacobian()
      Get the weighted Jacobian matrix.
      RealVector getPoint()
      Get the abscissa (independent variables) of this evaluation.
      RealVector getResiduals()
      Get the weighted residuals.
      double getRMS()
      Get the normalized cost.
      RealVector getSigma​(double covarianceSingularityThreshold)
      Get an estimate of the standard deviation of the parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • evaluations

        private final int evaluations
        number of evaluations to compute this optimum
      • iterations

        private final int iterations
        number of iterations to compute this optimum
    • Constructor Detail

      • OptimumImpl

        OptimumImpl​(LeastSquaresProblem.Evaluation value,
                    int evaluations,
                    int iterations)
        Construct an optimum from an evaluation and the values of the counters.
        Parameters:
        value - the function value
        evaluations - number of times the function was evaluated
        iterations - number of iterations of the algorithm
    • Method Detail

      • getEvaluations

        public int getEvaluations()
        Get the number of times the model was evaluated in order to produce this optimum.
        Specified by:
        getEvaluations in interface LeastSquaresOptimizer.Optimum
        Returns:
        the number of model (objective) function evaluations
      • getIterations

        public int getIterations()
        Get the number of times the algorithm iterated in order to produce this optimum. In general least squares it is common to have one evaluation per iterations.
        Specified by:
        getIterations in interface LeastSquaresOptimizer.Optimum
        Returns:
        the number of iterations
      • getCovariances

        public RealMatrix getCovariances​(double threshold)
        Get the covariance matrix of the optimized parameters.
        Note that this operation involves the inversion of the JTJ matrix, where J is the Jacobian matrix. The threshold parameter is a way for the caller to specify that the result of this computation should be considered meaningless, and thus trigger an exception.
        Specified by:
        getCovariances in interface LeastSquaresProblem.Evaluation
        Parameters:
        threshold - Singularity threshold.
        Returns:
        the covariance matrix.
      • getSigma

        public RealVector getSigma​(double covarianceSingularityThreshold)
        Get an estimate of the standard deviation of the parameters. The returned values are the square root of the diagonal coefficients of the covariance matrix, sd(a[i]) ~= sqrt(C[i][i]), where a[i] is the optimized value of the i-th parameter, and C is the covariance matrix.
        Specified by:
        getSigma in interface LeastSquaresProblem.Evaluation
        Parameters:
        covarianceSingularityThreshold - Singularity threshold (see computeCovariances).
        Returns:
        an estimate of the standard deviation of the optimized parameters
      • getRMS

        public double getRMS()
        Get the normalized cost. It is the square-root of the sum of squared of the residuals, divided by the number of measurements.
        Specified by:
        getRMS in interface LeastSquaresProblem.Evaluation
        Returns:
        the cost.
      • getResiduals

        public RealVector getResiduals()
        Get the weighted residuals. The residual is the difference between the observed (target) values and the model (objective function) value. There is one residual for each element of the vector-valued function. The raw residuals are then multiplied by the square root of the weight matrix.
        Specified by:
        getResiduals in interface LeastSquaresProblem.Evaluation
        Returns:
        the weighted residuals: W1/2 K.