- #1
Joe Prendergast
- 19
- 4
Hello, does anyone know how to retrieve the Hessian at the minimum when using method = ‘trust-constr’?
What software system does this question refer to?Joe Prendergast said:Hello, does anyone know how to retrieve the Hessian at the minimum when using method = ‘trust-constr’?
Python as stated in my subject line. Specifically the scipy package.renormalize said:What software system does this question refer to?
Thanks (sorry I overlooked your subject line!).Joe Prendergast said:Python as stated in my subject line. Specifically the scipy package.
Never hurts to repeat in the body of the post :)renormalize said:Thanks (sorry I overlooked your subject line!).
The 'trust-constr' method is an optimization algorithm in the SciPy library that is designed for constrained optimization problems. It uses a trust-region approach to minimize a function while satisfying constraints. This method is particularly useful for problems where the objective function is non-linear and may have both equality and inequality constraints.
In the 'trust-constr' method, the Hessian output can be provided to improve the optimization process. The Hessian matrix represents the second derivatives of the objective function, which can provide information about the curvature of the function. Users can specify the Hessian explicitly or use numerical approximations if they do not have an analytical form available.
To use the 'trust-constr' method with Hessian, you need to provide the objective function, the initial guess for the variables, and optionally, the constraints (both equality and inequality). If you are supplying the Hessian, you also need to provide a function that computes the Hessian matrix at the current point.
Yes, the 'trust-constr' method is suitable for large-scale optimization problems. It is designed to handle problems with many variables and constraints efficiently. However, the performance will depend on the availability of the Hessian and how it is computed, as well as the specific characteristics of the problem being solved.
If the computation of the Hessian is too slow, consider using numerical approximations instead of an analytical Hessian. You can also explore using finite difference methods to estimate the Hessian matrix. Additionally, simplifying the problem or reducing the dimensionality may help improve computational efficiency.