/** * Returns the upper bound of the support for the distribution. * * The upper bound of the support is the number of elements * * @return upper bound of the support * @since 2.2 */ public int getSupportUpperBound() { return getNumberOfElements(); }
/** * Returns the mean. * * For number of elements N and exponent s, the mean is * <code>Hs1 / Hs</code> where * <ul> * <li><code>Hs1 = generalizedHarmonic(N, s - 1)</code></li> * <li><code>Hs = generalizedHarmonic(N, s)</code></li> * </ul> * * @return the mean * @since 2.2 */ protected double getNumericalMean() { final int N = getNumberOfElements(); final double s = getExponent(); final double Hs1 = generalizedHarmonic(N, s - 1); final double Hs = generalizedHarmonic(N, s); return Hs1 / Hs; }
/** * Returns the variance. * * For number of elements N and exponent s, the mean is * <code>(Hs2 / Hs) - (Hs1^2 / Hs^2)</code> where * <ul> * <li><code>Hs2 = generalizedHarmonic(N, s - 2)</code></li> * <li><code>Hs1 = generalizedHarmonic(N, s - 1)</code></li> * <li><code>Hs = generalizedHarmonic(N, s)</code></li> * </ul> * * @return the variance * @since 2.2 */ protected double getNumericalVariance() { final int N = getNumberOfElements(); final double s = getExponent(); final double Hs2 = generalizedHarmonic(N, s - 2); final double Hs1 = generalizedHarmonic(N, s - 1); final double Hs = generalizedHarmonic(N, s); return (Hs2 / Hs) - ((Hs1 * Hs1) / (Hs * Hs)); } }