Added check_test_point method to Model#2936
Conversation
|
Related issue: #2509 |
|
I thought about calling it during |
ColCarroll
left a comment
There was a problem hiding this comment.
i really like this - it will simplify debugging a ton.
| if test_point is None: | ||
| test_point = self.test_point | ||
|
|
||
| return Series({RV.name:np.round(RV.logp(self.test_point), round_vals) for RV in self.basic_RVs}, |
There was a problem hiding this comment.
Any reason to round?
Also, what do you think about returning a pd.DataFrame with columns log-probability and test_point?
There was a problem hiding this comment.
I did not think that displaying logps to high precision was helpful, particularly since we are mostly looking for nans.
The DF is a good idea! Let me try and do that.
There was a problem hiding this comment.
I guess the problem with this is that the test_point for some variables is vector-valued, so it would not comport well to being displayed in a DataFrame cell.
* Added check_test_point function * Added change to RELEASE-NOTES * Fixed typo
* updated 'updating_priors' notebook * updated 'api_quickstart' notebook * updated 'AR' notebook * updated 'Bayes_factor' notebook * Added check_test_point method to Model (#2936) * Added check_test_point function * Added change to RELEASE-NOTES * Fixed typo * updated 'runing' typos to 'running' in these 4 notebooks
* Added check_test_point function * Added change to RELEASE-NOTES * Fixed typo
* updated 'updating_priors' notebook * updated 'api_quickstart' notebook * updated 'AR' notebook * updated 'Bayes_factor' notebook * Added check_test_point method to Model (pymc-devs#2936) * Added check_test_point function * Added change to RELEASE-NOTES * Fixed typo * updated 'runing' typos to 'running' in these 4 notebooks
Hopefully this is a useful diagnostic tool. It reports the log-probabilities of all model variables for a given test point (uses
self.test_pointif none is provided). Should be helpful when sampling fails due to nans.