public void largestNonDiagonalMagnitude(CorrelationMatrix r){
  TetradMatrix residual=r.getMatrix();
  for (int i=0; i < residual.columns(); i++) {
    double max=0;
    for (int j=0; j < residual.columns(); j++) {
      if (i == j)       continue;
      double temp=Math.abs(residual.get(j,i));
      if (temp > max)       max=temp;
    }
    residual.set(i,i,max);
  }
}

public void largestNonDiagonalMagnitude ( CorrelationMatrix r ) { TetradMatrix residual = r . getMatrix ( ) ; for ( int i = 0 ; i < residual . columns ( ) ; i ++ ) { double max = 0 ; for ( int j = 0 ; j < residual . columns ( ) ; j ++ ) { if ( i == j ) continue ; double temp = Math . abs ( residual . get ( j , i ) ) ; if ( temp > max ) max = temp ; } residual . set ( i , i , max ) ; } }
largest nondiagonal magnitude method . estimates the communality ( diagonal of the residual correlation matrix ) as the largest nondiagonal absolute value present in each column . tends to produce smaller numbers of factors than the unity method .
