List of usage examples for org.apache.commons.math.distribution PoissonDistribution inverseCumulativeProbability
int inverseCumulativeProbability(double p) throws MathException;
From source file:geogebra.kernel.statistics.AlgoInversePoisson.java
protected final void compute() { if (input[0].isDefined() && input[1].isDefined()) { double param = a.getDouble(); double val = b.getDouble(); try {/* w ww . jav a 2 s.c om*/ PoissonDistribution dist = getPoissonDistribution(param); double result = dist.inverseCumulativeProbability(val); // eg InversePascal[1,1,1] returns 2147483647 if (result >= Integer.MAX_VALUE) num.setUndefined(); else num.setValue(result + 1); } catch (Exception e) { num.setUndefined(); } } else num.setUndefined(); }
From source file:geogebra.common.kernel.statistics.AlgoInversePoisson.java
@Override public final void compute() { if (input[0].isDefined() && input[1].isDefined()) { double param = a.getDouble(); double val = b.getDouble(); try {// w w w. ja v a 2 s. c o m PoissonDistribution dist = getPoissonDistribution(param); double result = dist.inverseCumulativeProbability(val); // eg InversePascal[1,1,1] returns 2147483647 if (result >= Integer.MAX_VALUE) num.setUndefined(); else num.setValue(result + 1); } catch (Exception e) { num.setUndefined(); } } else num.setUndefined(); }