-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ExGaussian logp is numerical unstable #4045
Labels
Comments
Just tried this code to see if I can reproduce but it returns an error: ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-d4f49d90ca18> in <module>
11 y = st.exponnorm.rvs(nu, loc=mu, scale=sigma)
12
---> 13 pm.ExGaussian.dist(0., .25, 1./6).logp(y).tag.test_value
AttributeError: 'scratchpad' object has no attribute 'test_value' |
|
It does, thanks! And I can reproduce the problem: array([ 1.09121345e-01, -2.75359986e+00, -1.01118924e+01, 2.39749482e-01,
-3.03631310e-01, -inf, -1.20340373e+00, 2.73649008e-01,
-5.53724783e-01, 1.92089061e-01, -7.24266195e-01, -2.05114903e+00, ...] |
Closed
Closed
Merged
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reported by user on discourse: https://discourse.pymc.io/t/bad-initial-energy-when-trying-to-build-a-multivariate-exgaussian-model/5591/3
There is some numerical problem of the ExGaussian log_prob. Specifically, the
std_cdf
in the line below returns 0., which resulting inlogpow
returns-inf
https://github.com/pymc-devs/pymc3/blob/63eba59fe2c42c936136b24babf6ca1e3a777d74/pymc3/distributions/continuous.py#L3274
minimal reproducible example:
A tt.switch in ExGaussian logp to replace 0 with epsilon should be sufficient to fix this.
The text was updated successfully, but these errors were encountered: