Skip to content
Snippets Groups Projects
Commit 50543ac9 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Sample from second half of chain

parent ff4ad325
No related branches found
No related tags found
1 merge request!643Adding an ACT estimate for the walks
Pipeline #90829 passed
......@@ -643,7 +643,7 @@ def sample_rwalk_bilby(args):
if accept > walks:
act = np.max([1, autocorr_new(np.array(u_list).T)])
if len(u_list) > maxmcmc and accept > 0:
if accept + reject > maxmcmc and accept > 0:
if max_walk_warning:
warnings.warn(
"Hit maximum number of walks {} with accept={}, reject={}, "
......@@ -668,10 +668,11 @@ def sample_rwalk_bilby(args):
v = v_list[idx]
logl = logl_list[idx]
else:
warnings.warn("Returning the last point in the chain")
u = u_list[-1]
v = v_list[-1]
logl = logl_list[-1]
idx = np.random.randint(int(len(u_list) / 2), len(u_list))
logger.warning("Returning random point in second half of the chain")
u = u_list[idx]
v = v_list[idx]
logl = logl_list[idx]
blob = {'accept': accept, 'reject': reject, 'fail': nfail, 'scale': scale}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment