Skip to content

Commit

Permalink
Fix a bug in truncated Laplace's logpdf compute (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
horizon-blue authored Sep 7, 2024
1 parent 4568412 commit 9436068
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ def logpdf(self, obs, loc, scale, low, high, uniform_window_size):
assert low + uniform_window_size < high - uniform_window_size
laplace_logpdf = tfp.distributions.Laplace(loc, scale).log_prob(obs)
laplace_logp_below_low = tfp.distributions.Laplace(loc, scale).log_cdf(low)
laplace_logp_above_high = 1 - tfp.distributions.Laplace(loc, scale).log_cdf(
high
)
laplace_logp_above_high = tfp.distributions.Laplace(
loc, scale
).log_survival_function(high)
log_window_size = jnp.log(uniform_window_size)

return jnp.where(
Expand Down

0 comments on commit 9436068

Please sign in to comment.