/** * Constructs a Variance with the specified <code>isBiasCorrected</code> * property * * @param isBiasCorrected setting for bias correction - true means * bias will be corrected and is equivalent to using the argumentless * constructor */ public Variance(boolean isBiasCorrected) { moment = new SecondMoment(); this.isBiasCorrected = isBiasCorrected; }
/** * Constructs a Variance with default (true) <code>isBiasCorrected</code> * property. */ public Variance() { moment = new SecondMoment(); }
/** * {@inheritDoc} */ @Override public SecondMoment copy() { SecondMoment result = new SecondMoment(); // no try-catch or advertised NAE because args are guaranteed non-null copy(this, result); return result; }
/** * <p>Returns the sum of squared deviations of Y from its mean.</p> * * <p>If the model has no intercept term, <code>0</code> is used for the * mean of Y - i.e., what is returned is the sum of the squared Y values.</p> * * <p>The value returned by this method is the SSTO value used in * the {@link #calculateRSquared() R-squared} computation.</p> * * @return SSTO - the total sum of squares * @throws NullPointerException if the sample has not been set * @see #isNoIntercept() * @since 2.2 */ public double calculateTotalSumOfSquares() { if (isNoIntercept()) { return StatUtils.sumSq(getY().toArray()); } else { return new SecondMoment().evaluate(getY().toArray()); } }
/** * Constructs a Variance with default (true) <code>isBiasCorrected</code> * property. */ public Variance() { moment = new SecondMoment(); }
/** * Constructs a Variance with default (true) <code>isBiasCorrected</code> * property. */ public Variance() { moment = new SecondMoment(); }
/** * Constructs a Variance with the specified <code>isBiasCorrected</code> * property * * @param isBiasCorrected setting for bias correction - true means * bias will be corrected and is equivalent to using the argumentless * constructor */ public Variance(boolean isBiasCorrected) { moment = new SecondMoment(); this.isBiasCorrected = isBiasCorrected; }
private SecondMoment _getSecondMoment() { if (this.secondMoment == null) { this.secondMoment = new SecondMoment(); } return this.secondMoment; }
/** * Constructs a Variance with the specified <code>isBiasCorrected</code> * property * * @param isBiasCorrected setting for bias correction - true means * bias will be corrected and is equivalent to using the argumentless * constructor */ public Variance(boolean isBiasCorrected) { moment = new SecondMoment(); this.isBiasCorrected = isBiasCorrected; }
/** * {@inheritDoc} */ @Override public SecondMoment copy() { SecondMoment result = new SecondMoment(); // no try-catch or advertised NAE because args are guaranteed non-null copy(this, result); return result; }
/** * {@inheritDoc} */ @Override public SecondMoment copy() { SecondMoment result = new SecondMoment(); // no try-catch or advertised NAE because args are guaranteed non-null copy(this, result); return result; }
/** * <p>Returns the sum of squared deviations of Y from its mean.</p> * * <p>If the model has no intercept term, <code>0</code> is used for the * mean of Y - i.e., what is returned is the sum of the squared Y values.</p> * * <p>The value returned by this method is the SSTO value used in * the {@link #calculateRSquared() R-squared} computation.</p> * * @return SSTO - the total sum of squares * @throws NullPointerException if the sample has not been set * @see #isNoIntercept() * @since 2.2 */ public double calculateTotalSumOfSquares() { if (isNoIntercept()) { return StatUtils.sumSq(getY().toArray()); } else { return new SecondMoment().evaluate(getY().toArray()); } }
/** * <p>Returns the sum of squared deviations of Y from its mean.</p> * * <p>If the model has no intercept term, <code>0</code> is used for the * mean of Y - i.e., what is returned is the sum of the squared Y values.</p> * * <p>The value returned by this method is the SSTO value used in * the {@link #calculateRSquared() R-squared} computation.</p> * * @return SSTO - the total sum of squares * @throws NullPointerException if the sample has not been set * @see #isNoIntercept() * @since 2.2 */ public double calculateTotalSumOfSquares() { if (isNoIntercept()) { return StatUtils.sumSq(getY().toArray()); } else { return new SecondMoment().evaluate(getY().toArray()); } }
return new SecondMoment(); case GeometricMean: return new GeometricMean();