/** {@inheritDoc} */ @Override public Evaluation evaluate(final RealVector point) { return new DenseWeightedEvaluation(super.evaluate(point), weightSquareRoot); } };
/** * Configure the model function. * * @param value the model function value * @param jacobian the Jacobian of {@code value} * @return this */ public LeastSquaresBuilder model(final MultivariateVectorFunction value, final MultivariateMatrixFunction jacobian) { return model(LeastSquaresFactory.model(value, jacobian)); }
/** * Configure the convergence checker. * <p/> * This function is an overloaded version of {@link #checker(ConvergenceChecker)}. * * @param newChecker the convergence checker. * @return this */ public LeastSquaresBuilder checkerPair(final ConvergenceChecker<PointVectorValuePair> newChecker) { return this.checker(LeastSquaresFactory.evaluationChecker(newChecker)); }
/** * @param newCostRelativeTolerance Desired relative error in the sum of squares. * @return a new instance. */ public LevenbergMarquardtOptimizer withCostRelativeTolerance(double newCostRelativeTolerance) { return new LevenbergMarquardtOptimizer( initialStepBoundFactor, newCostRelativeTolerance, parRelativeTolerance, orthoTolerance, qrRankingThreshold); }
/** {@inheritDoc} */ public RealVector getPoint() { return value.getPoint(); } }
/** {@inheritDoc} * @param point*/ public Evaluation evaluate(final RealVector point) { return problem.evaluate(point); }
/** {@inheritDoc} */ public ConvergenceChecker<Evaluation> getConvergenceChecker() { return problem.getConvergenceChecker(); } }
/** * Configure the decomposition algorithm. * * @param newDecomposition the {@link Decomposition} algorithm to use. * @return a new instance. */ public GaussNewtonOptimizer withDecomposition(final Decomposition newDecomposition) { return new GaussNewtonOptimizer(newDecomposition); }
/** * Combine a {@link MultivariateVectorFunction} with a {@link * MultivariateMatrixFunction} to produce a {@link MultivariateJacobianFunction}. * * @param value the vector value function * @param jacobian the Jacobian function * @return a function that computes both at the same time */ public static MultivariateJacobianFunction model(final MultivariateVectorFunction value, final MultivariateMatrixFunction jacobian) { return new LocalValueAndJacobianFunction(value, jacobian); }
/** {@inheritDoc} */ public double getRMS() { return value.getRMS(); }
/** {@inheritDoc} */ public RealVector getResiduals() { return value.getResiduals(); }
/** {@inheritDoc} */ public int getObservationSize() { return problem.getObservationSize(); }
/** {@inheritDoc} */ public Incrementor getEvaluationCounter() { return problem.getEvaluationCounter(); }
/** {@inheritDoc} */ public RealMatrix getCovariances(double threshold) { return value.getCovariances(threshold); }
/** {@inheritDoc} */ public RealVector getStart() { return problem.getStart(); }
/** {@inheritDoc} */ public Incrementor getIterationCounter() { return problem.getIterationCounter(); }
/** {@inheritDoc} */ public double getCost() { return value.getCost(); }
/** * @param newParRelativeTolerance Desired relative error in the approximate solution * parameters. * @return a new instance. */ public LevenbergMarquardtOptimizer withParameterRelativeTolerance(double newParRelativeTolerance) { return new LevenbergMarquardtOptimizer( initialStepBoundFactor, costRelativeTolerance, newParRelativeTolerance, orthoTolerance, qrRankingThreshold); }
/** {@inheritDoc} */ public RealVector getPoint() { return unweighted.getPoint(); }
/** * Creates an optimizer set up to fit the appropriate curve. * <p> * The default implementation uses a {@link LevenbergMarquardtOptimizer * Levenberg-Marquardt} optimizer. * </p> * @return the optimizer to use for fitting the curve to the * given {@code points}. */ protected LeastSquaresOptimizer getOptimizer() { return new LevenbergMarquardtOptimizer(); }