openscm_calibration.minimize#
Minimisation helpers
Functions:
| Name | Description |
|---|---|
to_minimize_full |
Calculate cost for given set of parameters |
to_minimize_full #
to_minimize_full(
x: NDArray[number[Any]],
cost_calculator: SupportsCostCalculation[DataContainer],
model_runner: SupportsModelRun[DataContainer],
store: OptResStore[DataContainer] | None = None,
known_error: type[ValueError] | None = None,
) -> float
Calculate cost for given set of parameters
This is a function that can be minimised with scipy
Before passing to scipy, all the arguments except x should be filled
using e.g. :func:functools.partial
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
NDArray[number[Any]]
|
Parameter array |
required |
cost_calculator
|
SupportsCostCalculation[DataContainer]
|
Calculator of the cost function for each set of model results |
required |
model_runner
|
SupportsModelRun[DataContainer]
|
Model runner |
required |
store
|
OptResStore[DataContainer] | None
|
Store of results at each step in the optimisation (useful for plotting) |
None
|
known_error
|
type[ValueError] | None
|
Known error that can occur when solving. If any other error is encountered, it is raised rather than being allowed to pass. |
None
|
Returns:
| Type | Description |
|---|---|
Cost function for array ``x``
|
|