downhill_simplex_penalty module

Define a Downhill Simplex with penalty.

It is not intended to be used with phi_s fit. Approach is here to make the residuals grow when the constraints are not respected.

class DownhillSimplexPenalty(*args, history_kwargs=None, **kwargs)[source]

Bases: DownhillSimplex

A Downhill Simplex method, with a penalty function to consider constraints.

Everything is inherited from DownhillSimplex.

Parameters:

history_kwargs (dict | None, default: None)

supports_constraints: bool = True
__init__(*args, history_kwargs=None, **kwargs)[source]

Set additional information.

Parameters:

history_kwargs (dict | None, default: None)

Return type:

None

property _default_kwargs: dict[str, Any]

Create the kwargs for the optimisation.

_norm_wrapper_residuals(var)[source]

Give residuals with a penalty.

Parameters:

var (ndarray)

Return type:

float

_penalty(constraints_evaluations)[source]

Compute appropriate penalty.

Parameters:

constraints_evaluations (ndarray)

Return type:

float

_abc_impl = <_abc._abc_data object at 0x7318f91400c0>