MathPHP\Statistics\Regression\Methods\LeastSquares::sumOfSquaresRegression PHP Method

sumOfSquaresRegression() public method

The sum of the squares of the deviations of the predicted values from the mean value of a response variable, in a standard regression model. https://en.wikipedia.org/wiki/Explained_sum_of_squares SSreg = ∑(ŷᵢ - ȳ)² When a constant is fit to the regression, the average of y = average of ŷ. In the case where the constant is not fit, we use the sum of squares of the predicted value SSreg = ∑ŷᵢ²
public sumOfSquaresRegression ( ) : number
return number
    public function sumOfSquaresRegression()
    {
        if ($this->fit_constant == 1) {
            return RandomVariable::sumOfSquaresDeviations($this->Yhat());
        }
        return array_sum(Single::square($this->reg_Yhat));
    }