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:
equationslist of TensorVariable

Individual scalar equation graphs, each equal to zero at the steady state.

ss_input_nodeslist of TensorVariable

Scalar input nodes for each steady-state variable.

error_funcstr, 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.

Returns:
errorTensorVariable

Scalar error.

gradTensorVariable or None

Gradient of shape (n_var,), or None if use_jac is False.

hessTensorVariable or None

Hessian of shape (n_var, n_var), or None if use_hess is False.

hessp_outTensorVariable or None

Hessian-vector product output of shape (n_var,), or None if use_hessp is False.

hessp_pTensorVariable or None

Direction vector input for the Hessian-vector product, or None if use_hessp is False.