def resid_dev(self, endog, mu, scale=1.):
        r"""
        Returns the deviance residuals for the inverse Gaussian family.

        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
            An optional argument to divide the residuals by scale. The default
            is 1.

        Returns
        -------
        resid_dev : array
            Deviance residuals as defined below

        Notes
        -----
        .. math::

           resid\_dev_i = sign(Y_i - \mu_i) * 
                          \sqrt {(Y_i - \mu_i)^2 / (Y_i * \mu_i^2)} / scale
        """
        return np.sign(endog-mu) * np.sqrt((mu-endog)**2/(endog*mu**2))/scale
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/genmod/families/family.py/InverseGaussian.resid_dev/swapped operands of `-`