From 00dacd206e5ff3798b7b34c359dda644e8f767b5 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Sun, 31 May 2020 11:57:35 -0500 Subject: update contamination analysis step size This commit updates the step size used for the MCMC in the contamination analysis to 0.5 times the error returned by scanning near the minimum. I ran some tests and this seemed to be pretty efficient compared to either the full error or 0.1 times the error. I also reduced the number of workers to 10. --- utils/dc-closure-test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils/dc-closure-test') diff --git a/utils/dc-closure-test b/utils/dc-closure-test index 45c0f6e..43d26d3 100755 --- a/utils/dc-closure-test +++ b/utils/dc-closure-test @@ -383,7 +383,7 @@ def fit(data, sacrifice, steps): #samples = metropolis_hastings(nll,xopt,stepsizes,100000) #print("nll(xopt) = %.2g" % nll(xopt)) - pos = np.empty((100, len(x0)),dtype=np.double) + pos = np.empty((10, len(x0)),dtype=np.double) for i in range(pos.shape[0]): pos[i] = xopt + np.random.randn(len(x0))*stepsizes pos[i,:6] = np.clip(pos[i,:6],EPSILON,1e9) @@ -395,7 +395,7 @@ def fit(data, sacrifice, steps): nwalkers, ndim = pos.shape - proposal = get_proposal_func(stepsizes,low,high) + proposal = get_proposal_func(stepsizes*0.5,low,high) sampler = emcee.EnsembleSampler(nwalkers, ndim, lambda x, grad, fill_value: -nll(x,grad,fill_value), moves=emcee.moves.MHMove(proposal),args=[None,np.inf]) with np.errstate(invalid='ignore'): sampler.run_mcmc(pos, steps) -- cgit