/** * {@inheritDoc} * * The default implementation uses the identity * <p>{@code P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)}</p> * * @deprecated As of 3.1 (to be removed in 4.0). Please use * {@link #probability(double,double)} instead. */ @Deprecated public double cumulativeProbability(double x0, double x1) throws NumberIsTooLargeException { return probability(x0, x1); }
/** {@inheritDoc} */ @Override public double probability(double x0, double x1) throws NumberIsTooLargeException { if (x0 > x1) { throw new NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT, x0, x1, true); } if (x0 <= 0 || x1 <= 0) { return super.probability(x0, x1); } final double denom = shape * SQRT2; final double v0 = (FastMath.log(x0) - scale) / denom; final double v1 = (FastMath.log(x1) - scale) / denom; return 0.5 * Erf.erf(v0, v1); }
/** * {@inheritDoc} * * The default implementation uses the identity * <p>{@code P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)}</p> * * @deprecated As of 3.1 (to be removed in 4.0). Please use * {@link #probability(double,double)} instead. */ @Deprecated public double cumulativeProbability(double x0, double x1) throws NumberIsTooLargeException { return probability(x0, x1); }
/** * {@inheritDoc} * * The default implementation uses the identity * <p>{@code P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)}</p> * * @deprecated As of 3.1 (to be removed in 4.0). Please use * {@link #probability(double,double)} instead. */ @Deprecated public double cumulativeProbability(double x0, double x1) throws NumberIsTooLargeException { return probability(x0, x1); }
/** {@inheritDoc} */ @Override public double probability(double x0, double x1) throws NumberIsTooLargeException { if (x0 > x1) { throw new NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT, x0, x1, true); } if (x0 <= 0 || x1 <= 0) { return super.probability(x0, x1); } final double denom = shape * SQRT2; final double v0 = (Math.log(x0) - scale) / denom; final double v1 = (Math.log(x1) - scale) / denom; return 0.5 * Erf.erf(v0, v1); }
Number start = (Number) second; Number end = (Number) third; return realDistribution.probability(start.doubleValue(), end.doubleValue()); } else { throw new IOException("The probability function expects 2 or 3 parameters");
/** {@inheritDoc} */ @Override public double probability(double x0, double x1) throws NumberIsTooLargeException { if (x0 > x1) { throw new NumberIsTooLargeException(LocalizedFormats.LOWER_ENDPOINT_ABOVE_UPPER_ENDPOINT, x0, x1, true); } if (x0 <= 0 || x1 <= 0) { return super.probability(x0, x1); } final double denom = shape * SQRT2; final double v0 = (FastMath.log(x0) - scale) / denom; final double v1 = (FastMath.log(x1) - scale) / denom; return 0.5 * Erf.erf(v0, v1); }