Skip to content
Snippets Groups Projects
Commit 8c52644e authored by Matthew David Pitkin's avatar Matthew David Pitkin
Browse files

likelihood.py: fix install error

parent 3b9d00e6
No related branches found
No related tags found
1 merge request!132Add Poisson likelihood to core likelihood functions
...@@ -188,15 +188,15 @@ class PoissonLikelihood(Likelihood): ...@@ -188,15 +188,15 @@ class PoissonLikelihood(Likelihood):
"value!")) "value!"))
# Return the summed log likelihood # Return the summed log likelihood
return -self.N*rate + np.sum(self.counts*np.log(rate)) - return (-self.N*rate + np.sum(self.counts*np.log(rate))
self.sumlogfactorial - self.sumlogfactorial)
elif isinstance(rate, np.ndarray): elif isinstance(rate, np.ndarray):
# check rates are positive # check rates are positive
if np.any(rate < 0.): if np.any(rate < 0.):
raise ValueError(("Poisson rate function returns a negative")), raise ValueError(("Poisson rate function returns a negative",
" value!")) " value!"))
return np.sum(-rate + self.counts*np.log(rate)) - return (np.sum(-rate + self.counts*np.log(rate))
self.sumlogfactorial - self.sumlogfactorial)
else: else:
raise ValueError("Poisson rate function returns wrong value type!") raise ValueError("Poisson rate function returns wrong value type!")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment