ConceptPythonBeginner Least squares: what a fit minimizes, and why the residuals are squared lo, hi = np.percentile(chi2_sim / dof, [2.5, 97.5])return np.percentile(chi2_draws / (n_points - n_params), [2.5, 97.5])
ToolPythonIntermediate MCMC with emcee: the half-life and background of a counting experiment lo, med, hi = np.percentile(flat, [16, 50, 84], axis=0)c_lo, c_med, c_hi = np.percentile(curves, [16, 50, 84], axis=0)edges = np.percentile(flat, [0.05, 99.95], axis=0).T # shared axis limits per parameter