コード例 #1
0
 /**
  * Returns the sum of squared residuals.
  *
  * @return residual sum of squares
  * @since 2.2
  */
 public double calculateResidualSumOfSquares() {
   final RealVector residuals = calculateResiduals();
   return residuals.dotProduct(residuals);
 }
コード例 #2
0
 /**
  * Calculates the variance on the y by GLS.
  *
  * <pre>
  *  Var(y)=Tr(u' Omega^-1 u)/(n-k)
  * </pre>
  *
  * @return The Y variance
  */
 @Override
 protected double calculateYVariance() {
   RealVector residuals = calculateResiduals();
   double t = residuals.dotProduct(getOmegaInverse().operate(residuals));
   return t / (X.getRowDimension() - X.getColumnDimension());
 }