public boolean isConstantResponse ( ) { double m = Double . NaN ; for ( int b = 0 ; b < _bins . length ; b ++ ) { if ( _bins [ b ] == 0 ) continue ; if ( var ( b ) > 1e-14 ) return false ; double mean = mean ( b ) ; if ( mean != m ) if ( Double . isNaN ( m ) ) m = mean ; else if ( Math . abs ( m - mean ) > 1e-6 ) return false ; } return true ; }
Check for a constant response variable