List of usage examples for org.apache.commons.math.analysis.solvers NewtonSolver solve
@Deprecated public double solve(final double min, final double max) throws MaxIterationsExceededException, FunctionEvaluationException
From source file:dr.math.distributions.KernelDensityEstimatorDistribution.java
/** * quantile (inverse cumulative density function) of the distribution * * @param y argument//from w ww . j av a 2s . com * @return cdf value */ public double quantile(final double y) { final DifferentiableUnivariateRealFunction root = new DifferentiableUnivariateRealFunction() { @Override public UnivariateRealFunction derivative() { return pdfFunction; } @Override public double value(double x) throws FunctionEvaluationException { return cdfFunction.value(x) - y; } }; NewtonSolver solver = new NewtonSolver(root); double q; try { q = solver.solve(getFromPoint(), getToPoint()); } catch (MaxIterationsExceededException e) { throw new RuntimeException(e.getMessage()); } catch (FunctionEvaluationException e) { throw new RuntimeException(e.getMessage()); } return q; }