pysolvegn.study_optimization#
- study_optimization(terms, p0, parametrization=None, *, title='')[source]#
Study the Gauss-Newton Hessian built by the solver.
This function is deliberately implemented on top of
solve(). It does not rebuild the residuals, robust Jacobians, weights, losses, parametrization chain rule, or Hessian itself.The solver is executed with
max_iteration=0andhistory=True. Consequently, only the initial state is evaluated and no optimization step is performed.The analysis is therefore exactly consistent with the current solver implementation.
The Hessian returned by the solver is:
\[H = \sum_i w_i \tilde{J}_i^T \tilde{J}_i\]for
rJterms (where \(\tilde{J}_i\) is the Jacobian modified by the robust loss function and, if provided, the chain rule of the parametrization), and:\[H = \sum_i w_i H_i\]for
gHterms.If a parametrization is provided, the Hessian is expressed in the input parameter space of the parametrization.
The function displays:
the number of terms;
the number of equations and optimized parameters;
the individual and total costs;
the Hessian condition number;
the singular values of the Hessian;
the inverse singular values;
the estimated residual variance;
the parameter covariance and standard deviations;
the least observable parameter combinations;
the right singular vectors associated with the smallest singular values.
- Parameters:
terms (Union[Term, Sequence[Term]]) – Terms defining the least-squares problem.
p0 (ArrayLike) – Initial input parameters passed to
solve().parametrization (Optional[Parametrization], optional) – Parametrization applied to the input parameters.
title (str, optional) – Optional title printed before the analysis.
- Returns:
This function only prints the analysis.
- Return type:
None
Notes
The function intentionally calls the solver with:
max_iteration=0This guarantees that the exact same implementation used during optimization is responsible for constructing the Hessian.
The history of the returned
pysolvegn.SolveResultcontains:parameterscostscostresidualssecond_termhessian
No optimization step is performed.