#NEWLINE# def logpdf_link( self , inv_link_f , y , Y_metadata = None ) : #NEWLINE# #INDENT# "\n        Log Likelihood function given inverse link of f.\n\n        .. math::\n            \\ln p(y_{i}|\\lambda(f_{i})) = y_{i}\\log\\lambda(f_{i}) + (1-y_{i})\\log (1-f_{i})\n\n        :param inv_link_f: latent variables inverse link of f.\n        :type inv_link_f: Nx1 array\n        :param y: data\n        :type y: Nx1 array\n        :param Y_metadata: Y_metadata must contain 'trials'\n        :returns: log likelihood evaluated at points inverse link of f.\n        :rtype: float\n        " #NEWLINE# N = Y_metadata [ 'trials' ] #NEWLINE# nchoosey = ( ( special . gammaln ( ( N + 1 ) ) - special . gammaln ( ( y + 1 ) ) ) - special . gammaln ( ( ( N - y ) + 1 ) ) ) #NEWLINE# return ( ( nchoosey + ( y * np . log ( inv_link_f ) ) ) + ( ( N - y ) * np . log ( ( 1.0 - nchoosey ) ) ) )