/** * 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 NullArgumentException if either source or dest is null */ public static void copy(Skewness source, Skewness dest) throws NullArgumentException { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); dest.setData(source.getDataRef()); dest.moment = new ThirdMoment(source.moment.copy()); dest.incMoment = source.incMoment; } }
public static void main(String[] args) { final double[] values = new java.util.Random().doubles(5000).toArray(); final Skew stat1 = new Skew(); final org.apache.commons.math3.stat.descriptive.moment.Skewness stat2 = new org.apache.commons.math3.stat.descriptive.moment.Skewness(); for (double value : values) { stat1.add(value); stat2.increment(value); } final double result1 = stat1.getValue(); final double result2 = stat2.getResult(); if (result1 != result2) { throw new RuntimeException("Error: " + result1 + " != " + result2); } }
public Skew() { super(new org.apache.commons.math3.stat.descriptive.moment.Skewness()); } }
/** * Copy constructor, creates a new {@code Skewness} identical * to the {@code original} * * @param original the {@code Skewness} instance to copy * @throws NullArgumentException if original is null */ public Skewness(Skewness original) throws NullArgumentException { copy(original, this); }
if (test(values, begin, length) && length > 2 ){ Mean mean = new Mean();
public Skew() { super(new org.apache.commons.math3.stat.descriptive.moment.Skewness()); } }
/** * Copy constructor, creates a new {@code Skewness} identical * to the {@code original} * * @param original the {@code Skewness} instance to copy * @throws NullArgumentException if original is null */ public Skewness(Skewness original) throws NullArgumentException { copy(original, this); }
if (test(values, begin, length) && length > 2 ){ Mean mean = new Mean();
return new Product(); case Skewness: return new Skewness(); case StandardDeviation: return new StandardDeviation();
/** * 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 NullArgumentException if either source or dest is null */ public static void copy(Skewness source, Skewness dest) throws NullArgumentException { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); dest.setData(source.getDataRef()); dest.moment = new ThirdMoment(source.moment.copy()); dest.incMoment = source.incMoment; } }
/** * Copy constructor, creates a new {@code Skewness} identical * to the {@code original} * * @param original the {@code Skewness} instance to copy * @throws NullArgumentException if original is null */ public Skewness(Skewness original) throws NullArgumentException { copy(original, this); }
if (test(values, begin, length) && length > 2 ){ Mean mean = new Mean();
/** * 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 NullArgumentException if either source or dest is null */ public static void copy(Skewness source, Skewness dest) throws NullArgumentException { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); dest.setData(source.getDataRef()); dest.moment = new ThirdMoment(source.moment.copy()); dest.incMoment = source.incMoment; } }