bilby.core.sampler.dynesty_utils.AcceptanceTrackingRWalk
- class bilby.core.sampler.dynesty_utils.AcceptanceTrackingRWalk(old_act=None)[source]
Bases:
object
This is a modified version of dynesty.sampling.sample_rwalk that runs the MCMC random walk for a user-specified number of a crude approximation to the autocorrelation time.
This is the proposal method used by default for
Bilby<2
and corresponds to specifyingsample="rwalk"
Methods
__init__
([old_act])estimate_nmcmc
(accept_ratio[, safety, tau])Estimate autocorrelation length of chain using acceptance fraction
Attributes
old_act
- estimate_nmcmc(accept_ratio, safety=5, tau=None)[source]
Estimate autocorrelation length of chain using acceptance fraction
Using ACL = (2/acc) - 1 multiplied by a safety margin. Code adapted from:
- Parameters:
- accept_ratio: float [0, 1]
Ratio of the number of accepted points to the total number of points
- old_act: int
The ACT of the last iteration
- maxmcmc: int
The maximum length of the MCMC chain to use
- safety: int
A safety factor applied in the calculation
- tau: int (optional)
The ACT, if given, otherwise estimated.
Notes
This method does not compute a reliable estimate of the autocorrelation length for our proposal distributions.