def d2logpdf_dlink2(self, inv_link_f, y, Y_metadata=None):
N = Y_metadata['<STR_LIT>']<EOL>np.testing.assert_array_equal(N.shape, y.shape)<EOL>Ny = N-y<EOL>t1 = np.zeros(y.shape)<EOL>t2 = np.zeros(y.shape)<EOL>t1[y><NUM_LIT:0>] = -y[y><NUM_LIT:0>]/np.square(inv_link_f[y><NUM_LIT:0>])<EOL>t2[Ny><NUM_LIT:0>] = -(Ny[Ny><NUM_LIT:0>])/np.square(<NUM_LIT:1.>-inv_link_f[Ny><NUM_LIT:0>])<EOL>return t1+t2<EOL>
Hessian at y, given inv_link_f, w.r.t inv_link_f the hessian will be 0 unless i == j
i.e. second derivative logpdf at y given inverse link of f_i and inverse link of f_j  w.r.t inverse link of f_i and inverse link of f_j.


.. math::
    \\frac{d^{2}\\ln p(y_{i}|\\lambda(f_{i}))}{d\\lambda(f)^{2}} = \\frac{-y_{i}}{\\lambda(f)^{2}} - \\frac{(N-y_{i})}{(1-\\lambda(f))^{2}}

: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 not used in binomial
:returns: Diagonal of log hessian matrix (second derivative of log likelihood evaluated at points inverse link of f.
:rtype: Nx1 array

.. Note::
    Will return diagonal of hessian, since every where else it is 0, as the likelihood factorizes over cases
    (the distribution for y_i depends only on inverse link of f_i not on inverse link of f_(j!=i)