def likelihood_ratio_statistic(x, y):
 x[(x == 0)] = 1e-05
 y[(y == 0)] = 1e-05
 y *= (x.sum() / y.sum())
 lrs = (2 * (x * np.log((x / y))).sum())
 return lrs

def likelihood_ratio_statistic ( x , y ) : x [ ( x == 0 ) ] = 1e-05 y [ ( y == 0 ) ] = 1e-05 y *= ( x . sum ( ) / y . sum ( ) ) lrs = ( 2 * ( x * np . log ( ( x / y ) ) ) . sum ( ) ) return lrs
calculate likelihood ratio statistic for given distributions .