Skip to content

Updated DEMetropolis warnings #3721

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

Merged
merged 6 commits into from
Dec 11, 2019

Conversation

michaelosthege
Copy link
Member

@codecov
Copy link

codecov bot commented Dec 10, 2019

Codecov Report

Merging #3721 into master will decrease coverage by 0.01%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3721      +/-   ##
==========================================
- Coverage   89.94%   89.93%   -0.02%     
==========================================
  Files         134      134              
  Lines       20413    20422       +9     
==========================================
+ Hits        18361    18366       +5     
- Misses       2052     2056       +4
Impacted Files Coverage Δ
pymc3/step_methods/metropolis.py 86.79% <ø> (-1.03%) ⬇️
pymc3/step_methods/arraystep.py 93.61% <0%> (-0.71%) ⬇️
pymc3/tests/test_step.py 100% <100%> (ø) ⬆️
pymc3/sampling.py 83% <100%> (+0.11%) ⬆️

@junpenglao
Copy link
Member

@aloctavodia
Copy link
Member

aloctavodia commented Dec 11, 2019

We also already have warning for number of chains here:

https://github.com/pymc-devs/pymc3/blob/1c30a6f487afaeef73464a98320e35961b11873f/pymc3/step_methods/arraystep.py#L214-L216

Probably this warning should be removed in favour of the new one, because the later is more informative. Other than that this LGTM

@michaelosthege
Copy link
Member Author

michaelosthege commented Dec 11, 2019

We also already have warning for number of chains here:
https://github.com/pymc-devs/pymc3/blob/1c30a6f487afaeef73464a98320e35961b11873f/pymc3/step_methods/arraystep.py#L214-L216

Probably this warning should be removed in favour of the new one, because the later is more informative. Other than that this LGTM

No that's not possible: With less than 2 other chains, DEMetropolis can not work (ValueError, because no chains to sample a vector from), but with 2 < n_chains <= n_dims it does work, but it's really not recommended (UserWarning)

What happens if N ≤ d? Because N points lie in an N − 1
dimensional space, all proposals (2) will lie in this reduced
space when e = 0. Therefore convergence of DE-MC would
rely on e, which would take a long time if its variance is small.

(from ter Braak (2006))

@aloctavodia
Copy link
Member

We also already have warning for number of chains here:
https://github.com/pymc-devs/pymc3/blob/1c30a6f487afaeef73464a98320e35961b11873f/pymc3/step_methods/arraystep.py#L214-L216

Probably this warning should be removed in favour of the new one, because the later is more informative. Other than that this LGTM

No that's not possible: With less than 2 other chains, DEMetropolis can not work (ValueError, because no chains to sample a vector from), but with 2 < n_chains <= n_dims it does work, but it's really not recommended (UserWarning)

What happens if N ≤ d? Because N points lie in an N − 1
dimensional space, all proposals (2) will lie in this reduced
space when e = 0. Therefore convergence of DE-MC would
rely on e, which would take a long time if its variance is small.

(from ter Braak (2006))

You are right! What about making the error message more explicit?

@michaelosthege
Copy link
Member Author

We also already have warning for number of chains here:
https://github.com/pymc-devs/pymc3/blob/1c30a6f487afaeef73464a98320e35961b11873f/pymc3/step_methods/arraystep.py#L214-L216

Probably this warning should be removed in favour of the new one, because the later is more informative. Other than that this LGTM

No that's not possible: With less than 2 other chains, DEMetropolis can not work (ValueError, because no chains to sample a vector from), but with 2 < n_chains <= n_dims it does work, but it's really not recommended (UserWarning)

What happens if N ≤ d? Because N points lie in an N − 1
dimensional space, all proposals (2) will lie in this reduced
space when e = 0. Therefore convergence of DE-MC would
rely on e, which would take a long time if its variance is small.

(from ter Braak (2006))

You are right! What about making the error message more explicit?

Actually, it was possible to raise even earlier in the call tree.
I still kept the original check even though it should never trigger as long as pm.sample is used.

Also tried to write more informative messages. Is it what you had in mind?

Copy link
Member

@aloctavodia aloctavodia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@junpenglao junpenglao merged commit 86bb49a into pymc-devs:master Dec 11, 2019
sthagen added a commit to sthagen/pymc-devs-pymc that referenced this pull request Dec 11, 2019
@michaelosthege michaelosthege deleted the demcmc-warnings branch December 12, 2019 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants