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

Tracking acceptances #40

Open
cpfiffer opened this issue Nov 23, 2020 · 4 comments
Open

Tracking acceptances #40

cpfiffer opened this issue Nov 23, 2020 · 4 comments

Comments

@cpfiffer
Copy link
Member

cpfiffer commented Nov 23, 2020

We are not currently tracking acceptances, which is a statistic that could be useful for manual tuning. We need to change the Transition struct to track accept/reject.

In addition to this, the AdpativeProposal code in from #39 has some legacy stuff that mutates the sampler in place, as opposed to tracking the total number of draws. A fix for this would allow the AdaptiveProposal code to track the total number of draws within each Transition, so any mutation can be removed from the system.

Check out this discussion for more context.

@cpfiffer cpfiffer changed the title Yes of course, Int <-> Integer confusion... Tracking acceptances Nov 23, 2020
@sellingsrud
Copy link

What's the status on this?

@cpfiffer
Copy link
Member Author

cpfiffer commented Jun 2, 2022

No change, happy to accept PRs!

@sellingsrud
Copy link

Gotcha, I'll see if I manage to put in some effort.

This is in principle pretty simple right? (And simpler than implementing an adaptive scheme which tunes it for you).

Is it enough to change the Transition struct to keep a number of draws and number of accepted, and include the correct arithmetic in the AbstractMCMC.step function so that the new Transition created has updated acceptance rate?

My concern doing this myself is that it requires efficiency, which is not my strong suit in Julia.

For example, does it slow down a lot if I change from returning transition_prev if not accepted to making a new Transition object and returning that?

@ParadaCarleton
Copy link
Member

Gotcha, I'll see if I manage to put in some effort.

This is in principle pretty simple right? (And simpler than implementing an adaptive scheme which tunes it for you).

Is it enough to change the Transition struct to keep a number of draws and number of accepted, and include the correct arithmetic in the AbstractMCMC.step function so that the new Transition created has updated acceptance rate?

My concern doing this myself is that it requires efficiency, which is not my strong suit in Julia.

For example, does it slow down a lot if I change from returning transition_prev if not accepted to making a new Transition object and returning that?

Hi, thanks for offering to help! I don't think this would make a lot of difference to efficiency, and you shouldn't worry too much about precisely optimizing the code here. Feel free to make a PR!

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

No branches or pull requests

3 participants