scipy_optimizer#

class pyhf.optimize.opt_scipy.scipy_optimizer(*args, **kwargs)#

Bases: pyhf.optimize.mixins.OptimizerMixin

Optimizer that uses scipy.optimize.minimize().

__init__(*args, **kwargs)[source]#

Initialize the scipy_optimizer.

See pyhf.optimize.mixins.OptimizerMixin for other configuration options.

Parameters:
  • tolerance (float) – Tolerance for termination. See specific optimizer for detailed meaning. Default is None.

  • solver_options (dict) – additional solver options. See scipy.optimize.show_options() for additional options of optimization solvers.

Attributes

name#
tolerance#
solver_options#
maxiter#
verbose#

Methods

_get_minimizer(objective_and_grad, init_pars, init_bounds, fixed_vals=None, do_grad=False, par_names=None)[source]#
_minimize(minimizer, func, x0, do_grad=False, bounds=None, fixed_vals=None, options={})[source]#

Same signature as scipy.optimize.minimize().

Minimizer Options:
  • maxiter (int): Maximum number of iterations. Default is 100000.

  • verbose (bool): Print verbose output during minimization. Default is False.

  • method (str): Minimization routine. Default is 'SLSQP'.

  • tolerance (float): Tolerance for termination. See specific optimizer for detailed meaning. Default is None.

  • solver_options (dict): additional solver options. See scipy.optimize.show_options() for additional options of optimization solvers.

Returns:

the fit result

Return type:

fitresult (scipy.optimize.OptimizeResult)