Parameter Estimators¶
- class ionworkspipeline.ParameterEstimator(**kwargs: Any)¶
Base class for all parameter estimators. Parameter estimators find an optimal set of parameters by minimizing an objective function.
Subclasses should override: - run(): Execute the estimation algorithm - Class attributes for capabilities (scalar_output, probabilistic, etc.)
Parameters¶
- **kwargs
Arguments passed to the underlying estimation algorithm.
Extends:
ConfigMixinSee also:
ParameterEstimator— field-level documentation.- property cost: ObjectiveFunction | None¶
Cost function used by the estimator.
- property gradient: Callable[[ndarray], ndarray]¶
Objective function gradient (uses finite differences if not provided).
- property objective_and_gradient: Callable[[ndarray], tuple[float, ndarray]]¶
Objective function and gradient (uses finite differences if not provided).
- run(x0: ndarray) Any¶
Run the estimator. Must be implemented by the subclass.
Parameters¶
- x0array_like
Initial guess for the independent variables.
Returns¶
- ParameterEstimatorResult
OptimizationResultfor optimizers,PosteriorResultfor samplers,RegressionResultfor regressors.
- set_bounds(bounds: tuple[ndarray, ndarray]) None¶
Set the bounds using the correct format for the estimator.
Converts from canonical (lower_array, upper_array) to estimator-specific format.
- set_eq_constraints(eq_constraints: list[Callable]) None¶
Set equality constraint functions (should evaluate to zero).
Raises NotImplementedError if the estimator doesn’t support custom constraints.
- set_gradient(gradient: Callable[[ndarray], ndarray]) None¶
Set the objective function parameter gradient.
- set_ineq_constraints(ineq_constraints: list[Callable]) None¶
Set inequality constraint functions (should evaluate to > 0).
Raises NotImplementedError if the estimator doesn’t support custom constraints.
- set_objective(objective: Callable[[ndarray], float | ndarray]) None¶
Set the objective function to be minimized.
- set_objective_and_gradient(objective_and_gradient: Callable[[ndarray], tuple[float, ndarray]]) None¶
Set the objective function and its parameter gradient.
- set_residual_jacobian(jacobian: Callable[[ndarray], ndarray]) None¶
Set an analytic residual Jacobian
J(x) = d(residual)/dx.jacobian(x)must return an array of shape(n_residuals, n_params). Least-squares optimizers (ScipyLeastSquares,ScipyLsqLinear) use it instead of finite differences when present.
- class ionworkspipeline.parameter_estimators.Chain(*estimators)¶
Chain of estimators to be run in sequence, where the output of one estimator is the initial guess for the next estimator.
Parameters¶
- *estimatorslist of estimator objects
The estimators to be run in sequence.
Extends:
list- property cost¶
If all estimators have the same default cost function, return it. Otherwise, raise an error.