-
-
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
Triangular distribution random sampling is incorrectly implemented #3225
Comments
Yes, it looks like |
lucianopaz
added a commit
to lucianopaz/pymc
that referenced
this issue
Nov 14, 2018
…istently with scipy.stats. Added test and updated example code.
twiecki
pushed a commit
that referenced
this issue
Nov 17, 2018
…with scipy.stats. Added test and updated example code. (#3253)
ColCarroll
pushed a commit
to ColCarroll/pymc3
that referenced
this issue
Nov 22, 2018
…istently with scipy.stats. Added test and updated example code. (pymc-devs#3253)
junpenglao
pushed a commit
that referenced
this issue
Dec 3, 2018
* Fix for #3225. Made Triangular `c` attribute be handled consistently with scipy.stats. Added test and updated example code. * Fix for #3210 which uses a completely different approach than PR #3214. It uses a context manager inside `draw_values` that makes all the values drawn from `TensorVariables` or `MultiObservedRV`s available to nested calls of the original call to `draw_values`. It is partly inspired by how Edward2 approaches the problem of forward sampling. Ed2 tensors fix a `_values` attribute after they first call `sample` and then only return that. They can do it because of their functional scheme, where the entire graph is recreated each time the generative function is called. Our object oriented paradigm cannot set a fixed _values, it has to know it is in the context of a single `draw_values` call. That is why I opted for context managers to store the drawn values. * Removed leftover print statement * Added release notes and draw values context managers to mixture and multivariate distributions that make many calls to draw_values or other distributions random methods within their own random.
twiecki
pushed a commit
that referenced
this issue
Dec 22, 2018
* Fix for #3225. Made Triangular `c` attribute be handled consistently with scipy.stats. Added test and updated example code. * Added a more detailed error message for Broken pipes. * Not a fix for #3140 * Fixed import of time. Trimmed the broken pipe exception handling. Added release notes. * Moved maintenance message to release notes of pymc3.7
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There seems to be a problem with the way scipy.stats.triang is called by Triangular.random.
An error is thrown even if you use a combination of 'upper', 'lower', and 'c' arguments found in the documentation, see below.
The fact that I can recover the correct parameters in the model below if I catch the error suggests that the issue is limited to when random is sampled.
Calling sample_ppc(dummytrace, model=dummymodel) throws the same error, presumably because it calls the random method.
However, when I change the way scipy.stats.triang is called in the source code to be analogous to that below, it doesn't fix the problem, so maybe I'm missing something.
Description of your problem
Please provide a minimal, self-contained, and reproducible example.
Please provide the full traceback.
If the error is caught:
If the error is raised:
Please provide any additional information below.
Versions and main components
The text was updated successfully, but these errors were encountered: