code: def dlogpdf_link_dr(self, inv_link_f, y, Y_metadata=None):
          
          # c = Y_metadata['censored']
          # c = np.zeros((y.shape[0],))
          c = np.zeros_like(y)
          if Y_metadata is not None and 'censored' in Y_metadata.keys():
              c = Y_metadata['censored']
  
          link_f = inv_link_f #FIXME: Change names consistently...
          y_link_f = y/link_f
          log_y_link_f = np.log(y) - np.log(link_f)
          y_link_f_r = y_link_f**self.r
  
          #In terms of link_f
          censored = c*(-y_link_f_r*log_y_link_f/(1 + y_link_f_r))
          uncensored = (1-c)*(1./self.r + np.log(y) - np.log(link_f) - (2*y_link_f_r*log_y_link_f) / (1 + y_link_f_r))
  
          dlogpdf_dr = censored + uncensored
          return dlogpdf_dr
docs: Gradient of the log-likelihood function at y given f, w.r.t shape parameter
  
          .. math::
  
          :param inv_link_f: latent variables link(f)
          :type inv_link_f: Nx1 array
          :param y: data
          :type y: Nx1 array
          :param Y_metadata: includes censoring information in dictionary key 'censored'
          :returns: derivative of likelihood evaluated at points f w.r.t variance parameter
          :rtype: float