/** {@inheritDoc} */ @Override public double inverseCumulativeProbability(final double p) throws OutOfRangeException { if (p < 0.0 || p > 1.0) { throw new OutOfRangeException(p, 0, 1); } return value; }
@Override public double inverseCumulativeProbability(final double p) throws OutOfRangeException { if (p < 0.0 || p > 1.0) { throw new OutOfRangeException(p, 0, 1); } return p * (upper - lower) + lower; }
/** * Get the simplex point stored at the requested {@code index}. * * @param index Location. * @return the point at location {@code index}. */ public PointValuePair getPoint(int index) { if (index < 0 || index >= simplex.length) { throw new OutOfRangeException(index, 0, simplex.length - 1); } return simplex[index]; }
/** * Creates a new {@link UniformCrossover} policy using the given mixing ratio. * * @param ratio the mixing ratio * @throws OutOfRangeException if the mixing ratio is outside the [0, 1] range */ public UniformCrossover(final double ratio) throws OutOfRangeException { if (ratio < 0.0d || ratio > 1.0d) { throw new OutOfRangeException(LocalizedFormats.CROSSOVER_RATE, ratio, 0.0d, 1.0d); } this.ratio = ratio; }
/** {@inheritDoc} */ @Override public void addToEntry(int index, double increment) throws OutOfRangeException { try { data[index] += increment; } catch(IndexOutOfBoundsException e){ throw new OutOfRangeException(LocalizedFormats.INDEX, index, 0, data.length - 1); } }
/** {@inheritDoc} */ @Override public double inverseCumulativeProbability(final double p) throws OutOfRangeException { if (p < 0.0 || p > 1.0) { throw new OutOfRangeException(p, 0, 1); } return p * (upper - lower) + lower; }
/** * Sets the elitism rate, i.e. how many best chromosomes will be directly transferred to the next generation [in %]. * * @param elitismRate how many best chromosomes will be directly transferred to the next generation [in %] * @throws OutOfRangeException if the elitism rate is outside the [0, 1] range */ public void setElitismRate(final double elitismRate) throws OutOfRangeException { if (elitismRate < 0 || elitismRate > 1) { throw new OutOfRangeException(LocalizedFormats.ELITISM_RATE, elitismRate, 0, 1); } this.elitismRate = elitismRate; }
/** * Check significance level. * * @param alpha significance level * @throws OutOfRangeException if the significance level is out of bounds. */ private void checkSignificanceLevel(final double alpha) throws OutOfRangeException { if (alpha <= 0 || alpha > 0.5) { throw new OutOfRangeException(LocalizedFormats.SIGNIFICANCE_LEVEL, alpha, 0.0, 0.5); } }
/** * Constructs a PSquarePercentile with the specific percentile value. * @param p the percentile * @throws OutOfRangeException if p is not greater than 0 and less * than or equal to 100 */ public PSquarePercentile(final double p) { if (p > 100 || p < 0) { throw new OutOfRangeException(LocalizedFormats.OUT_OF_RANGE, p, 0, 100); } this.quantile = p / 100d;// always set it within (0,1] }
/** * Return marker height given index * * @param markerIndex index of marker within (1,6) * @return marker height */ public double height(final int markerIndex) { if (markerIndex >= markerArray.length || markerIndex <= 0) { throw new OutOfRangeException(markerIndex, 1, markerArray.length); } return markerArray[markerIndex].markerHeight; }
/** {@inheritDoc} */ @Override public double inverseCumulativeProbability(double p) throws OutOfRangeException { if (p < 0.0 || p > 1.0) { throw new OutOfRangeException(p, 0.0, 1.0); } else if (p == 0) { return 0.0; } else if (p == 1) { return Double.POSITIVE_INFINITY; } return s * Math.log(p / (1.0 - p)) + mu; }
/** {@inheritDoc} */ @Override public double inverseCumulativeProbability(double p) throws OutOfRangeException { if (p < 0.0 || p > 1.0) { throw new OutOfRangeException(p, 0.0, 1.0); } else if (p == 0) { return Double.NEGATIVE_INFINITY; } else if (p == 1) { return Double.POSITIVE_INFINITY; } double x = (p > 0.5) ? -Math.log(2.0 - 2.0 * p) : Math.log(2.0 * p); return mu + beta * x; }
/** * {@inheritDoc} */ public double estimate(final int index) { if (index < LOW || index > HIGH) { throw new OutOfRangeException(index, LOW, HIGH); } return markerArray[index].estimate(); }
/** {@inheritDoc} */ @Override public double inverseCumulativeProbability(final double p) throws OutOfRangeException { if (p < 0.0 || p > 1.0) { throw new OutOfRangeException(p, 0, 1); } final double t = Erf.erfcInv(p); return mu + halfC / (t * t); }
/** {@inheritDoc} */ @Override public double getEntry(int index) throws OutOfRangeException { try { return data[index]; } catch (IndexOutOfBoundsException e) { throw new OutOfRangeException(LocalizedFormats.INDEX, index, 0, getDimension() - 1); } }
/** {@inheritDoc} * @since 3.2 */ @Override public double inverseCumulativeProbability(final double p) throws OutOfRangeException { if (p < 0.0 || p > 1.0) { throw new OutOfRangeException(p, 0, 1); } return mean + standardDeviation * SQRT2 * Erf.erfInv(2 * p - 1); }
/** * Check if a row index is valid. * * @param row Row index to check. * @throws OutOfRangeException if {@code index} is not valid. */ protected void checkRowIndex(final int row) throws OutOfRangeException { if (row < 0 || row >= getRowDimension()) { throw new OutOfRangeException(LocalizedFormats.ROW_INDEX, row, 0, getRowDimension() - 1); } }
/** {@inheritDoc} */ @Override public double inverseCumulativeProbability(double p) throws OutOfRangeException { if (p < 0.0 || p > 1.0) { throw new OutOfRangeException(p, 0.0, 1.0); } else if (p == 0) { return Double.NEGATIVE_INFINITY; } else if (p == 1) { return Double.POSITIVE_INFINITY; } return mu - FastMath.log(-FastMath.log(p)) * beta; }
/** * Check whether an index is valid. * * @param index Index to check. * @throws OutOfRangeException if the index is not valid. */ private void checkIndex(final int index) throws OutOfRangeException { if (index < 0 || index >= getDimension()) { throw new OutOfRangeException(index, 0, getDimension() - 1); } }
/** * Check if an index is valid. * * @param index Index to check. * @exception OutOfRangeException if the index is not valid. */ private void checkIndex(final int index) throws OutOfRangeException { if (index < 0 || index >= getDimension()) { throw new OutOfRangeException(LocalizedFormats.INDEX, index, 0, getDimension() - 1); } }