gEconpy.model.perturbation.check_bk_condition#
- gEconpy.model.perturbation.check_bk_condition(A, B, C, D, tol=1e-08, verbose=True, on_failure='ignore', return_value='dataframe')#
Compute the generalized eigenvalues of system in the form presented in [1].
Per [2], the number of unstable eigenvalues (\(|v| > 1\)) should not be greater than the number of forward-looking variables. Failing this test suggests timing problems in the definition of the model.
- 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.
- verbose: bool, default: True
Flag to print the results of the test, otherwise the eigenvalues are returned without comment.
- on_failure: str, default: ‘ignore’
Action to take if the Blanchard-Kahn condition is not satisfied. Valid values are ‘ignore’ and ‘raise’.
- return_value: string, default: ‘dataframe’
Controls what is returned by the function. Valid values are ‘dataframe’, ‘bool’, and ‘none’. If df, a dataframe containing eigenvalues is returned. If ‘bool’, a boolean indicating whether the BK condition is satisfied. If None, nothing is returned.
- tol: float, 1e-8
Tolerance below which numerical values are considered zero
- Returns:
bk_result, bool orpd.DataFrame, optional.Return value requested. Datatype corresponds to what was requested in the
return_valueargument:None, If return_value is ‘none’
condition_satisfied, bool, if return_value is ‘bool’, returns True if the Blanchard-Kahn condition is satisfied, False otherwise.
Eigenvalues, pd.DataFrame, if return_value is ‘df’, returns a dataframe containing the real and imaginary components of the system’s, eigenvalues, along with their modulus.