pub fn minimize_trust_region(
f: impl FnMut(&[f64]) -> f64,
grad: impl FnMut(&[f64]) -> Vec<f64>,
hess: impl FnMut(&[f64]) -> Array2<f64>,
x0: &[f64],
method: TrustRegionMethod,
options: TrustRegionOptions,
) -> Result<TrustRegionResult, ErrorsJSL>Expand description
Minimises f with gradient and Hessian by a trust-region Newton method (SciPy’s
minimize(method='trust-ncg' | 'dogleg' | 'trust-exact')). Each iteration minimises the
quadratic model within a ball of radius Δ, compares the actual reduction with the predicted
one, ρ = (f(x) − f(x + p)) / (m(0) − m(p)), quarters Δ if ρ < ¼, doubles it (up to the
maximum) if ρ > ¾ and the step reached the boundary, and accepts the step if ρ > η.