diff options
author | tlatorre <tlatorre@uchicago.edu> | 2020-05-31 11:57:35 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2020-05-31 11:57:35 -0500 |
commit | 00dacd206e5ff3798b7b34c359dda644e8f767b5 (patch) | |
tree | ee6518e56c38e1d6d1e9b10c77718dbc0ebcca0a /utils/dc | |
parent | d46e6c04c61cc9774a0ddede53092a7c66a8a273 (diff) | |
download | sddm-00dacd206e5ff3798b7b34c359dda644e8f767b5.tar.gz sddm-00dacd206e5ff3798b7b34c359dda644e8f767b5.tar.bz2 sddm-00dacd206e5ff3798b7b34c359dda644e8f767b5.zip |
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.
Diffstat (limited to 'utils/dc')
-rwxr-xr-x | utils/dc | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -453,7 +453,7 @@ if __name__ == '__main__': #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) @@ -465,7 +465,7 @@ if __name__ == '__main__': 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, args.steps) |