code: def logpdf_link(self, inv_link_f, y, Y_metadata=None):
          
          N = Y_metadata['trials']
          np.testing.assert_array_equal(N.shape, y.shape)
  
          nchoosey = special.gammaln(N+1) - special.gammaln(y+1) - special.gammaln(N-y+1)
          
          Ny = N-y
          t1 = np.zeros(y.shape)
          t2 = np.zeros(y.shape)
          t1[y>0] = y[y>0]*np.log(inv_link_f[y>0])
          t2[Ny>0] = Ny[Ny>0]*np.log(1.-inv_link_f[Ny>0])
          
          return nchoosey + t1 + t2
docs: Log Likelihood function given inverse link of f.
  
          .. math::
              \\ln p(y_{i}|\\lambda(f_{i})) = y_{i}\\log\\lambda(f_{i}) + (1-y_{i})\\log (1-f_{i})
  
          :param inv_link_f: latent variables inverse link of f.
          :type inv_link_f: Nx1 array
          :param y: data
          :type y: Nx1 array
          :param Y_metadata: Y_metadata must contain 'trials'
          :returns: log likelihood evaluated at points inverse link of f.
          :rtype: float