You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In all the tests that I have done I don't think I have seen any benefits from reflective or periodic conditions which makes me wonder whether they are useful at all or not.
Here is the example where in theory periodic conditions should make sense, but here for rwalk sampler the number of function calls is actually smaller when not using periodic option and for the rslice it's exactly the same. Only for unif sampler the usage of periodic leads to 20% smaller number of ncalls
importnumpyasnpimportdynestynlive=100printing=Truendim=2defloglike(x):
return-0.5*x[1]**2-10*np.cos(np.pi*x[0])
defprior_transform(x):
return (2*x-1)
defdoit():
dynamic=Truesampler='rwalk'# hard test of dynamic sampler with high dlogz_init and small number# of live pointsper= [0]
per=Nonerstate=np.random.default_rng(1)
ifdynamic:
dns=dynesty.DynamicNestedSampler(loglike,
prior_transform,
ndim,
nlive=nlive,
sample=sampler,
periodic=per,
rstate=rstate)
else:
dns=dynesty.NestedSampler(loglike,
prior_transform,
ndim,
nlive=nlive,
sample=sampler,
periodic=per,
rstate=rstate)
dns.run_nested(print_progress=printing)
returndns.resultsif__name__=='__main__':
res=doit()
I think part of the problem lies in the clustering. I.e. periodic= makes sense if the code would recognise the posterior mode that is wrapping around the boundary as a single mode, but that's not what's happening. The clustering/ellipsoid splitting is not aware of that.
But even without addressing the issue of clustering, it's not clear if
the benefit of periodic conditions is actually worth anything measurable (at least for rwalk/slice)
it's implemented correctly for non-unif
Also it is clear that we need an example that should serve as test-case for periodic doing anything useful (like the one given here; but maybe there is a better one).
Thoughts ?
The text was updated successfully, but these errors were encountered:
The number of likelihood evaluations is essentially a deterministic function of the MCMC length + number of live points + likelihood for rwalk, so I would expect the number of calls per run to not be strongly affected.
What is strongly affected is the quality of the convergence. Did you look at the posteriors in this case? In my experience, the periodic boundaries (for periodic parameters) significantly decrease the required MCMC length to get unbiased posteriors.
In all the tests that I have done I don't think I have seen any benefits from reflective or periodic conditions which makes me wonder whether they are useful at all or not.
Here is the example where in theory periodic conditions should make sense, but here for rwalk sampler the number of function calls is actually smaller when not using periodic option and for the rslice it's exactly the same. Only for unif sampler the usage of periodic leads to 20% smaller number of ncalls
But even without addressing the issue of clustering, it's not clear if
Also it is clear that we need an example that should serve as test-case for periodic doing anything useful (like the one given here; but maybe there is a better one).
Thoughts ?
The text was updated successfully, but these errors were encountered: