code: def log_pdf(self, y, mu, weights=None):
          
          if weights is None:
              weights = np.ones_like(mu)
          gamma = weights / self.scale
          return sp.stats.invgauss.logpdf(y, mu, scale=1./gamma)
docs: computes the log of the pdf or pmf of the values under the current distribution
  
          Parameters
          ----------
          y : array-like of length n
              target values
          mu : array-like of length n
              expected values
          weights : array-like shape (n,) or None, default: None
              containing sample weights
              if None, defaults to array of ones
  
          Returns
          -------
          pdf/pmf : np.array of length n