AdvancedMH.jl icon indicating copy to clipboard operation
AdvancedMH.jl copied to clipboard

Tracking acceptances

Open cpfiffer opened this issue 5 years ago • 4 comments

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 avatar Nov 23 '20 17:11 cpfiffer

What's the status on this?

sellingsrud avatar Jun 02 '22 12:06 sellingsrud

No change, happy to accept PRs!

cpfiffer avatar Jun 02 '22 22:06 cpfiffer

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?

sellingsrud avatar Jun 03 '22 15:06 sellingsrud

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!

ParadaCarleton avatar Jan 08 '23 22:01 ParadaCarleton