Skip to content
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

ENH Add burn and thin kwargs to sample. #1562

Merged
merged 2 commits into from Nov 29, 2016
Merged

ENH Add burn and thin kwargs to sample. #1562

merged 2 commits into from Nov 29, 2016

Conversation

twiecki
Copy link
Member

@twiecki twiecki commented Nov 29, 2016

Closes #1010.

@ColCarroll
Copy link
Member

LGTM

@twiecki twiecki merged commit f61d8cd into master Nov 29, 2016
@twiecki twiecki deleted the add_burn_thin branch November 29, 2016 10:09
@fonnesbeck
Copy link
Member

There is never a good reason to thin traces.

@twiecki
Copy link
Member Author

twiecki commented Nov 29, 2016 via email

@fonnesbeck
Copy link
Member

If you are thinning just to save memory, then you should not have sampled as much in the first place. Almost always (in fact, I can't think of any other use), thinning is performed to deal with autocorrelation. All that autocorrelation does (in a converged chain) is reduce your effective sample size. So, thinning is doing exactly what autocorrelation is doing -- reducing your sample size. If you want to reduce autocorrelation, you need to change your model, change your sampler, or both. Thinning is of no benefit.

@@ -265,8 +276,9 @@ def _iter_sample(draws, step, start=None, trace=None, chain=0, tune=None,
if i == tune:
step = stop_tuning(step)
point = step.step(point)
strace.record(point)
yield strace
if (i % thin == 0) and (i >= burn):
Copy link
Member

Choose a reason for hiding this comment

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

I'm definitely not a fan of adding two condition checks at every iteration to add a feature we already had.

@twiecki
Copy link
Member Author

twiecki commented Nov 29, 2016 via email

@twiecki twiecki restored the add_burn_thin branch November 29, 2016 16:29
ColCarroll pushed a commit to ColCarroll/pymc3 that referenced this pull request Dec 2, 2016
* ENH Add burn and thin kwargs to sample.

* MAINT Move new thin and burn behind start kwarg. Make test use kwargs.
ColCarroll pushed a commit to ColCarroll/pymc3 that referenced this pull request Dec 3, 2016
* ENH Add burn and thin kwargs to sample.

* MAINT Move new thin and burn behind start kwarg. Make test use kwargs.
@junpenglao junpenglao deleted the add_burn_thin branch June 26, 2017 12:26
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.

None yet

3 participants