diff options
-rwxr-xr-x | utils/chi2 | 16 |
1 files changed, 1 insertions, 15 deletions
@@ -366,23 +366,9 @@ def do_fit(data,muon,data_mc,bins,steps,print_nll=False,walkers=100,thin=10): """ nll = make_nll(data,muon,data_mc,bins,print_nll) - x0 = np.array(PRIORS) - opt = nlopt.opt(nlopt.LN_SBPLX, len(x0)) - opt.set_min_objective(nll) - low = np.array(PRIORS_LOW) - high = np.array(PRIORS_HIGH) - opt.set_lower_bounds(low) - opt.set_upper_bounds(high) - opt.set_ftol_abs(1e-2) - opt.set_initial_step([0.01]*len(x0)) - - pos = np.empty((walkers, len(x0)),dtype=np.double) + pos = np.empty((walkers, len(PRIORS)),dtype=np.double) for i in range(pos.shape[0]): pos[i] = truncnorm_scaled(PRIORS_LOW,PRIORS_HIGH,PRIORS,PRIOR_UNCERTAINTIES) - pos[i,:] = np.clip(pos[i,:],low,high) - pos[i] = opt.optimize(pos[i]) - with printoptions(precision=2, suppress=True): - print("pos[%i] = %s, nll = %.2f" % (i, pos[i], opt.last_optimum_value())) nwalkers, ndim = pos.shape |