Skip to content

pymc3.effective_n can return negative results #1770

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

Closed
aseyboldt opened this issue Feb 10, 2017 · 3 comments · Fixed by #1772
Closed

pymc3.effective_n can return negative results #1770

aseyboldt opened this issue Feb 10, 2017 · 3 comments · Fixed by #1772

Comments

@aseyboldt
Copy link
Member

In traces with negative autocorrelation pymc3 sometimes returns negative estimates for the number of effective samples:

import pymc3

class DummyTrace:
    varnames = ['a']
    nchains = 2
    def get_values(self, *args, **kwargs):
        return [[0, 1, 0, 1], [0, 1, 0, 1]]
    
pymc3.effective_n(DummyTrace())

This returns {'a': -8.0}

@twiecki
Copy link
Member

twiecki commented Feb 10, 2017

CC @aloctavodia.

@aloctavodia
Copy link
Member

@twiecki I have not worked on the effective sample size (probably you are thinking about the effective number of parameters). Anyway I can take a look at this tonight. Is clear that it should handle negative correlation.

@twiecki
Copy link
Member

twiecki commented Feb 11, 2017

Thanks @aloctavodia. I had somehow assumed you worked on this, didn't mean to pressure you into fixing this but appreciate you taking a look.

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 a pull request may close this issue.

3 participants