/** * {@inheritDoc} */ @Override public ThirdMoment copy() { ThirdMoment result = new ThirdMoment(); copy(this, result); return result; }
/** * {@inheritDoc} */ @Override public void clear() { super.clear(); m4 = Double.NaN; }
/** * {@inheritDoc} */ public long getN() { return moment.getN(); }
/** * @see org.apache.commons.math.stat.descriptive.StorelessUnivariateStatistic#increment(double) */ public void increment(final double d) { if (incMoment) { moment.increment(d); } }
/** * Constructs a Skewness */ public Skewness() { incMoment = true; moment = new ThirdMoment(); }
/** * Copy constructor, creates a new {@code ThirdMoment} identical * to the {@code original} * * @param original the {@code ThirdMoment} instance to copy */ public ThirdMoment(ThirdMoment original) { copy(original, this); }
/** * {@inheritDoc} */ @Override public void increment(final double d) { if (incMoment) { moment.increment(d); } }
/** * Constructs a Skewness */ public Skewness() { incMoment = true; moment = new ThirdMoment(); }
/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * * @param source FourthMoment to copy * @param dest FourthMoment to copy to * @throws NullPointerException if either source or dest is null */ public static void copy(FourthMoment source, FourthMoment dest) { ThirdMoment.copy(source, dest); dest.m4 = source.m4; } }
/** * {@inheritDoc} */ @Override public ThirdMoment copy() { ThirdMoment result = new ThirdMoment(); copy(this, result); return result; }
/** * @see org.apache.commons.math.stat.descriptive.StorelessUnivariateStatistic#getN() */ public long getN() { return moment.getN(); }
/** * {@inheritDoc} */ @Override public void increment(final double d) { if (incMoment) { moment.increment(d); } }
/** * {@inheritDoc} */ @Override public void clear() { if (incMoment) { moment.clear(); } }
/** * Constructs a Skewness */ public Skewness() { incMoment = true; moment = new ThirdMoment(); }
/** * Copy constructor, creates a new {@code ThirdMoment} identical * to the {@code original} * * @param original the {@code ThirdMoment} instance to copy */ public ThirdMoment(ThirdMoment original) { copy(original, this); }
/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * * @param source Skewness to copy * @param dest Skewness to copy to * @throws NullPointerException if either source or dest is null */ public static void copy(Skewness source, Skewness dest) { dest.moment = new ThirdMoment(source.moment.copy()); dest.incMoment = source.incMoment; } }
/** * {@inheritDoc} */ public long getN() { return moment.getN(); }
/** * {@inheritDoc} */ @Override public void increment(final double d) { if (n < 1) { m4 = 0.0; m3 = 0.0; m2 = 0.0; m1 = 0.0; } double prevM3 = m3; double prevM2 = m2; super.increment(d); double n0 = n; m4 = m4 - 4.0 * nDev * prevM3 + 6.0 * nDevSq * prevM2 + ((n0 * n0) - 3 * (n0 -1)) * (nDevSq * nDevSq * (n0 - 1) * n0); }
/** * {@inheritDoc} */ @Override public void clear() { if (incMoment) { moment.clear(); } }
/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * * @param source FourthMoment to copy * @param dest FourthMoment to copy to * @throws NullPointerException if either source or dest is null */ public static void copy(FourthMoment source, FourthMoment dest) { ThirdMoment.copy(source, dest); dest.m4 = source.m4; } }