Skip to main content

compute_param_sensitivity

Function compute_param_sensitivity 

Source
pub fn compute_param_sensitivity<S, F>(
    build_problem: F,
    params: &[S],
    names: &[&str],
    eps: Option<S>,
) -> Result<ParamSensitivity<S>, OptimError>
where S: Scalar + SimpleEntity + Conjugate<Canonical = S> + ComplexField, F: Fn(&[S]) -> OptimProblem<S>,
Expand description

Compute parametric sensitivity of an optimization problem.

build_problem is a closure that takes a parameter vector and returns an OptimProblem ready to solve. For each parameter, a central finite difference is used to estimate dx*/dp_j.

§Arguments

  • build_problem - Factory that builds an OptimProblem from a parameter vector.
  • params - Nominal parameter values.
  • names - Human-readable names for each parameter.
  • eps - Relative perturbation size (default 1e-5).

§Returns

A ParamSensitivity matrix of shape n_vars x n_params.