commons-statistics-regression/src/main/java/org/apache/commons/statistics/regression/stored/ols/OLSRegression.java
/**
     * <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
     */

Returns the sum of squared deviations of Y from its mean.


If the model has no intercept term, 0 is used for the mean of Y
- i.e., what is returned is the sum of the squared Y values.


The value returned by this method is the SSTO value used in the
#calculateRSquared() R-squared computation.

@return SSTO - the total sum of squares
Returns the sum of squared deviations of Y from its mean . If the model has no intercept term 0 is used for the mean of Y - i . e . what is returned is the sum of the squared Y values . The value returned by this method is the SSTO value used in the #calculateRSquared () R - squared computation . @return SSTO - the total sum of squares
public double calculateTotalSumOfSquares() {
        if (getHasIntercept()) {
            return StatUtils.sumSq(getY().toArray1D());
        } else {
            return new SecondMoment().evaluate(getY().toArray1D());
        }
    }
public double calculateTotalSumOfSquares ( ) { if ( getHasIntercept ( ) ) { return StatUtils . sumSq ( getY ( ) . toArray1D ( ) ) ; } else { return new SecondMoment ( ) . evaluate ( getY ( ) . toArray1D ( ) ) ; } }
<p>
 Returns the sum of squared deviations of Y from its mean.
<p > Returns the sum of squared deviations of Y from its mean .