question: public double entropy ( int g , int lag ) { double h = 0.0 ; int n = cases . length - lag ; double ln2 = Math . log ( 2.0 ) ; int n0 = 0 ; for ( int i = 0 ; i < n ; i ++ ) { if ( cases [ i + lag ] [ g ] == 0 ) { n0 ++ ; } } double p ; if ( n0 == 0 || n0 == n ) { return h ; } else { p = ( double ) n0 / ( double ) n ; h = - ( p * Math . log ( p ) + ( 1.0 - p ) * Math . log ( 1.0 - p ) ) / ln2 ; } return h ; }
target:  This method implements the same definition of entropy as above but this specialized version is intended to be used by the mutualInformation method (viz).  This method computes the entropy of a gene's binarized expressions from a point in time until the end of the data signal.  This is useful in the normalization of the mutual information.