Skip to content

FEAT: discard dynesty mcmc chains that are too short - #1154

Open
ColmTalbot wants to merge 6 commits into
bilby-dev:mainfrom
ColmTalbot:dynesty-block-too-short-mcmc
Open

ColmTalbot wants to merge 6 commits into
bilby-dev:mainfrom
ColmTalbot:dynesty-block-too-short-mcmc

Conversation

@ColmTalbot

Copy link
Copy Markdown
Collaborator

Following from #1153 at the beginning of the MCMC stage if walks is set to a low value, the first MCMC chains are too short and can be unreliable (see the little spike near ~180).

image

We can check after the MCMC finishes but before the point is returned if the actual number of accepted steps follows the correct distribution (binomial, N=walks, p=naccept/walks). This shouldn't increase the cost significantly (at least not beyond a working case), since by definition we need to run a longer MCMC in this case.

With this change, that goes away.

image

I'm not 100% about whether this is too strict and can introduce some stealth bias. If this is the case, we might want a flag to only do this during a warm up phase and not later in the run.

@ColmTalbot ColmTalbot added <10 lines sampling Issues about sampling algorithms, their efficiency and robustness dynesty labels Sep 29, 2026
@ColmTalbot
ColmTalbot requested a review from a team September 29, 2026 20:29
Comment thread bilby/core/sampler/dynesty_utils.py Outdated
@ColmTalbot ColmTalbot added the to discuss To be discussed on an upcoming call label Oct 5, 2026
@mj-will mj-will removed the to discuss To be discussed on an upcoming call label Oct 19, 2026
@GregoryAshton

Copy link
Copy Markdown
Collaborator

I can't see a button to approve, but I am happy with it going in as a "debug" statement for now.

@ColmTalbot
ColmTalbot force-pushed the dynesty-block-too-short-mcmc branch from 2e73449 to 2a65016 Compare October 21, 2026 16:18
@ColmTalbot
ColmTalbot requested a review from a team October 21, 2026 16:18

@GregoryAshton GregoryAshton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dynesty sampling Issues about sampling algorithms, their efficiency and robustness <10 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants