Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log Cdf of GenExtreme outputs negative infinity instead of zero at extreme right #349

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pymc_experimental/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ def logcdf(value, mu, sigma, xi):
pt.isclose(xi, 0), -pt.exp(-scaled), -pt.pow(1 + xi * scaled, -1 / xi)
)

logc = pt.switch(1 + xi * (value - mu) / sigma > 0, logc_expression, -np.inf)
logc = pt.switch(
1 + xi * (value - mu) / sigma > 0, logc_expression, pt.switch(xi > 0, -np.inf, 0)
)

return check_parameters(
logc, sigma > 0, pt.and_(xi > -1, xi < 1), msg="sigma > 0 or -1 < xi < 1"
Expand Down
Loading