Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Adaptive temperature spacing not improving convergence of model evidence #15

Open
ljschumacher opened this issue Apr 20, 2020 · 0 comments

Comments

@ljschumacher
Copy link

I have been using you code for model selection, for which I have been calculating evidence using the built-in thermodynamic integration.

However I am finding that the adaptive temperature spacing does not improve the convergence of the model evidence estimates. I don't have a minimal working example, but here is the result from my actual use case:
evidence_convergence_nsamples_nw40_adaptive.pdf
Blue solid line is with adaptive=True, orange dashed line is adaptive=False. I've checked that the non-adaptive case has converged after 40k samples, but the adaptive case doesn't seem to. They both select the same model as best (shown above), but arrive at a different value for the evidence

Is there an example code I can run to test this adaptive sampling?

I'm also wondering about this comment in ptemcee/ensemble.py:

def step(self):
        self._stretch(self.x, self.logP, self.logl)
        self.x = self._temperature_swaps(self.x, self.logP, self.logl)
        ratios = self.swaps_accepted / self.swaps_proposed

        # TODO: Should the notion of a 'complete' iteration really include the temperature adjustment?
        if self.adaptive and self.ntemps > 1:
            dbetas = self._get_ladder_adjustment(self.time,
                                                 self.betas,
                                                 ratios)
            self.betas += dbetas
            self.logP += self._tempered_likelihood(self.logl, betas=dbetas)

        self.time += 1

Are you sure it is implemented correctly?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant