tracts.driver_utils._summarize_step_results#

_summarize_step_results(params_found, likelihoods, parameter_handler, param_names, step_label=None, likelihood_tolerance=0.5)#

Print per-run optimization results and select the best run.

Parameters:
  • params_found (list[ndarray]) – A list of arrays of parameters found by the optimization runs, where each array corresponds to one run and is in optimizer parameter space.

  • likelihoods (list[float]) – A list of likelihoods corresponding to each set of parameters found by the optimization runs.

  • parameter_handler (FixedParametersHandler) – The parameter handler for the demographic model.

  • param_names (list[str]) – A list of parameter names corresponding to the parameters in the demographic model, used for printing results.

  • step_label (str | None) – A label for the optimization step, used for printing results.

  • likelihood_tolerance (float) – Absolute tolerance used to decide whether a run reached a likelihood value close to the best one.

Return type:

tuple[ndarray, float]

Returns:

  • np.ndarray – An array of the optimal parameters in physical parameter space, corresponding to the highest likelihood among the runs.

  • float – The optimal likelihood as a float.