protected double doSolve() throws TooManyEvaluationsException { double min = getMin(); double max = getMax(); verifyInterval(min, max); final double absoluteAccuracy = getAbsoluteAccuracy(); double m; double fm; fmin = computeObjectiveValue(min); fm = computeObjectiveValue(m);
private static int computeMinimum(final double interval, final double confidence) { final UnivariateFunction f = new UnivariateFunction() { @Override public double value(final double n) { double t; if (Math.ceil(n) == FastMath.floor(n)) { t = new TDistribution((int) n).inverseCumulativeProbability(1 - confidence / 2); } else { double t1 = new TDistribution((int) FastMath.ceil(n)).inverseCumulativeProbability((1 - confidence / 2)) * (n - Math.floor(n)); double t2 = new TDistribution((int) FastMath.floor(n)).inverseCumulativeProbability((1 - confidence / 2)) * (Math.ceil(n) - n); t = t1 + t2; } double value = 2 * t / n; return value - interval; } }; final BisectionSolver bs = new BisectionSolver(); return (int) Math.ceil(bs.solve(Integer.MAX_VALUE, f, 1, Integer.MAX_VALUE)); }
BaseAbstractUnivariateSolver<UnivariateFunction> solver = null; if (method.equals("Bisection")) { solver = new BisectionSolver(); } else if (method.equals("Brent")) { solver = new BrentSolver();
protected double doSolve() throws TooManyEvaluationsException { double min = getMin(); double max = getMax(); verifyInterval(min, max); final double absoluteAccuracy = getAbsoluteAccuracy(); double m; double fm; fmin = computeObjectiveValue(min); fm = computeObjectiveValue(m);
protected double doSolve() throws TooManyEvaluationsException { double min = getMin(); double max = getMax(); verifyInterval(min, max); final double absoluteAccuracy = getAbsoluteAccuracy(); double m; double fm; fmin = computeObjectiveValue(min); fm = computeObjectiveValue(m);