Updated other likelihoods to give back logpdf and gradients for each link_f rather than summing on the inside

This commit is contained in:
Alan Saul 2015-03-09 10:27:21 +00:00
parent 48821a6b73
commit 233c5ee8b4
7 changed files with 22 additions and 42 deletions

View file

@ -105,7 +105,7 @@ class Poisson(Likelihood):
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 link(f_i) not on link(f_(j!=i))
"""
return -y/(link_f**2)
return -y/(link_f**2)
def d3logpdf_dlink3(self, link_f, y, Y_metadata=None):
"""
@ -122,7 +122,6 @@ class Poisson(Likelihood):
:returns: third derivative of likelihood evaluated at points f
:rtype: Nx1 array
"""
assert np.atleast_1d(link_f).shape == np.atleast_1d(y).shape
d3lik_dlink3 = 2*y/(link_f)**3
return d3lik_dlink3