Description
Currently dlogz and dlogz_init values are taken out of thin air pretty much and they are often set to 0.01. But there is a way of motivating their choice.
The rationale there is the following.
I'll assume we're sampling an N-dim Gaussian, with n live points and aim to have Neff samples. I'll also define as Z(r) as posterior volume within a ball radius r.
Given that we want
The remaining
Given that
Here is the code doing this calculation:
import scipy.optimize
import scipy.special
import numpy as np
def getdlogz(Neff, ndim, nlive):
def func(r):
# this is Z(r) == 1/Neff eqn
return scipy.special.gammainc(ndim / 2., r**2 / 2.) - 1 / Neff
p0 = scipy.special.gamma(ndim / 2.)**(1. / ndim)
ret = scipy.optimize.root(func, p0)
r1 = ret.x[0]
# this is the radius of the sphere corresponding to 1/neff=Z
r2 = r1 * (nlive**(1. / ndim))
# this is the radius of outer most point if we have nlive uniform pts
ret = -np.log1p(-scipy.special.gammainc(ndim / 2., r2**2 / 2))
# this is dlogz corresponding to the outermost point
return ret
For example for ndim=4, nlive=100, neff=100 that gives dlogz=0.6
ndim=100, nlive=100, neff=100 that gives dlogz=0.04
ndim=10, nlive=100, neff=10000 gives dlogz =0.005
This is a motivation in terms of Neff. I haven't thought about motivation in terms of logz accuracy. But presumably if we cap the neff to be larger than 100 in the calculation above that will guarantee that our innermost point will correspond to Z_in/Z_tot = 0.01 which should be good enough for good logz accuracy.
Thoughts @joshspeagle ?
Activity