gEconpy.model.steady_state.build_minimize_graphs#
- gEconpy.model.steady_state.build_minimize_graphs(equations, ss_input_nodes, error_func='squared', use_jac=True, use_hess=False, use_hessp=True)#
Build the pytensor graphs needed by
scipy.optimize.minimize.The equations are stacked into a residual vector and reduced to a scalar error. Only the requested derivative graphs are constructed.
- Parameters:
- equations
listofTensorVariable Individual scalar equation graphs, each equal to zero at the steady state.
- ss_input_nodes
listofTensorVariable Scalar input nodes for each steady-state variable.
- error_func
str, optional Error metric. Default is
'squared'.- use_jacbool, optional
Whether to build the gradient graph. Default is True.
- use_hessbool, optional
Whether to build the full Hessian graph. Default is False.
- use_hesspbool, optional
Whether to build the Hessian-vector product graph. Default is True.
- equations
- Returns:
- error
TensorVariable Scalar error.
- grad
TensorVariableorNone Gradient of shape
(n_var,), or None ifuse_jacis False.- hess
TensorVariableorNone Hessian of shape
(n_var, n_var), or None ifuse_hessis False.- hessp_out
TensorVariableorNone Hessian-vector product output of shape
(n_var,), or None ifuse_hesspis False.- hessp_p
TensorVariableorNone Direction vector input for the Hessian-vector product, or None if
use_hesspis False.
- error