Mh_tune_jscale : How much does it slow down the chain compution?

Dear Dynare team,
thank you very much for the new release and for integrating the mh_tune_jscale feature. I am currently working with a very long chain (1,500,000 draws) and so this feature might be very useful. I was wondering much longer will it take for the chain to complete if I use the mh_tune_jscale, instead of working with a fixed m_jscale? Or is that really impossible to say in general?

When I tried with just 100 draws, it seemed that it took much longer to complete the chain with mh_tune_jscale. But I suspect that the costs of tuning in terms of time probably tend to be concentrated at the beginning of the chain? And that the further the algorithm is into the chain the smaller the additional tuning is necessary to hit the acceptance ratio target, because, for a given scaling parameter, the acceptance ratio usually tends to move less later in the chain?

Best,
Ansgar

Dear Ansgar,

This option works basically as what is done with mode_compute=6 (which has the “optimal” scale parameter as an output). We first run a MCMC (without keeping the draws) by regularly adjusting the scale parameter to achieve the targeted acceptance ratio. When the scale parameter is stable enough (across MCMC iterations) and the desired acceptance ratio attained, this MCMC is stopped, and we run the standard Metropolis Hastings algorithm. So clearly you will need more draws than if you start your Metropolis Hastings with the “good” scale parameter… But at least the procedure is automatic and you don’t have to search for the scale parameter (which would also require some time).

Best,
Stéphane.

Dear Stéphane,
ah I see, many thanks for your quick responise. And is the scale parameter resulting from the tuning saved in the mh_history file after the tuning, so I can use it later to calibrate mj_scale? I didn’t find it there, but I aborted the MCMC run before it was completed (but after the tuning phase was finished). Knowing the value resulting from the tuning would be useful because it happened to me several times that the acceptance ratio drifted quite a bit over the course of the chain, so the tuning can obviously not be perfect, but the resulting scaling parameter could it least serve as an upper (or lower) bound…
Best,
Ansgar

The mh_history contains it in record.ProposalScaleVec. Also, the log-file should have a display like

mh_jscale has been set equal to XXXX

Thank you, but is it stored there directly after the tuning phase is over? Or only once the MCMC run is completed? I checked the mh_history file after an aborted run because I wanted to know which parameter the tuning procedure had set, but I don’t think record.ProposalScaleVec was there.
Best,
Ansgar

No, unfortunately it is only set after estimation. I proposed a change at https://git.dynare.org/Dynare/dynare/-/merge_requests/1717

Your best hope is to look at the output in the log-file.

Thank you, Johannes. I have always thought that great minds think alike ;). Have a nice weekend.