def loglike(self, endog, mu, freq_weights=1, scale=1.):
        r"""
        The log-likelihood function in terms of the fitted mean response.

        Parameters
        ----------
        endog : array-like
            Endogenous response variable
        mu : array-like
            Fitted mean response variable
        freq_weights : array-like
            1d array of frequency weights. The default is 1.
        scale : float, optional
            Not used for the Binomial GLM.

        Returns
        -------
        llf : float
            The value of the loglikelihood function evaluated at
            (endog,mu,freq_weights,scale) as defined below.

        Notes
        --------
        If the endogenous variable is binary:

        .. math::

         llf = scale * \sum_i (y_i * \log(\mu_i/(1-\mu_i)) + \log(1-\mu_i)) *
               freq\_weights_i

        If the endogenous variable is binomial:

        .. math::

           llf = scale * \sum_i freq\_weights_i * (\ln \Gamma(n+1) -
                 \ln \Gamma(y_i + 1) - \ln \Gamma(n_i - y_i +1) + y_i *
                 \log(\mu_i / (1 - \mu_i)) + n * \log(1 - \mu_i))

        where :math:`y_i = Y_i * n_i` with :math:`Y_i` and :math:`n_i` as
        defined in Binomial initialize.  This simply makes :math:`y_i` the
        original number of successes.
        """

        if np.shape(self.n) == () and self.n == 1:
            return scale * np.sum((endog * np.log(mu/(1 - mu) + 1e-200) +
                                   np.log(mu - 1)) * freq_weights)
        else:
            y = endog * self.n  # convert back to successes
            return scale * np.sum((special.gammaln(self.n + 1) -
                                   special.gammaln(y + 1) -
                                   special.gammaln(self.n - y + 1) + y *
                                   np.log(mu/(1 - mu)) + self.n *
                                   np.log(1 - mu)) * freq_weights)
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/genmod/families/family.py/Binomial.loglike/swapped operands of `-`