gEconpy.solvers.cycle_reduction.solve_policy_function_with_cycle_reduction#

gEconpy.solvers.cycle_reduction.solve_policy_function_with_cycle_reduction(A, B, C, D, max_iter=100, tol=1e-08, verbose=True)#

Solve quadratic matrix equation of the form $A0x^2 + A1x + A2 = 0$ via cycle reduction algorithm of [1].

Returns policy function matrix T and shock impact matrix R, which together define a linear DSGE system.

Parameters:
A: np.ndarray

Jacobian matrix of the DSGE system, evaluated at the steady state, taken with respect to past variables values that are known when decision-making: those with t-1 subscripts.

B: np.ndarray

Jacobian matrix of the DSGE system, evaluated at the steady state, taken with respect to variables that are observed when decision-making: those with t subscripts.

C: np.ndarray

Jacobian matrix of the DSGE system, evaluated at the steady state, taken with respect to variables that enter in expectation when decision-making: those with t+1 subscripts.

D: np.ndarray

Jacobian matrix of the DSGE system, evaluated at the steady state, taken with respect to exogenous shocks.

max_iter: int, default: 1000

Maximum number of iterations to perform before giving up.

tol: float, default: 1e-7

Floating point tolerance used to detect algorithmic convergence

verbose: bool, default: True

If true, prints the sum of squared residuals that result when the system is computed used the solution.

Returns:
T: ArrayLike

Transition matrix T in state space jargon. Gives the effect of variable values at time t on the values of the variables at time t+1.

R: ArrayLike

Selection matrix R in state space jargon. Gives the effect of exogenous shocks at the t on the values of variables at time t+1.

result: str

String describing result of the cycle reduction algorithm

log_norm: float

Log L1 matrix norm of the first matrix (A2 -> A1 -> A0) that did not converge.