(x, y)
return lrs
Calculate likelihood ratio statistic for given distributions.

    Parameters
    ----------
    x : ndarray
        Observed distribution.
    y : ndarray
        Expected distribution.

    Returns
    -------
    lrs : float
        Likelihood ratio statistic result.
Calculate likelihood ratio statistic for given distributions.
Calculate likelihood ratio statistic for given distributions .
def likelihood_ratio_statistic(x, y):
    """
    Calculate likelihood ratio statistic for given distributions.

    Parameters
    ----------
    x : ndarray
        Observed distribution.
    y : ndarray
        Expected distribution.

    Returns
    -------
    lrs : float
        Likelihood ratio statistic result.
    """
    x[x == 0] = 1e-5
    y[y == 0] = 1e-5
    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-5 y [ y == 0 ] = 1e-5 y *= x . sum ( ) / y . sum ( ) lrs = 2 * ( x * np . log ( x / y ) ) . sum ( ) return lrs