gEconpy.solvers.gensys.qzdiv#

gEconpy.solvers.gensys.qzdiv(stake, A, B, Q, Z)#

Christopher Sim’s qzdiv.

Takes upper-triangular matrices \(A\), \(B\) and orthonormal matrices \(Q\), \(Z\), and rearranges them so that all cases of abs(B(i, i) / A(i, i)) > stake are in the lower-right corner, while preserving upper-triangular and orthonormal properties, and maintaining the relationships \(Q^TAZ'\) and \(Q^TBZ'\). The columns of v are sorted correspondingly.

Matrices \(A\), \(B\), \(Q\), and \(Z\) are the output of the generalized Schur decomposition (QZ decomposition) of the system matrices \(G_0\) and \(G_1\). A and B are upper triangular, with the properties \(QAZ^T = G_0\) and \(QBZ^T = G_1\).

Parameters:
stakefloat

Largest positive value for which an eigenvalue is considered stable.

Anp.ndarray

Upper-triangular matrix.

Bnp.ndarray

Upper-triangular matrix.

Qnp.ndarray

Matrix of left Schur vectors.

Znp.ndarray

Matrix of right Schur vectors.

Returns:
tuple of np.ndarray

A, B, Q, Z matrices sorted such that all unstable roots are placed in the lower-right corners of the matrices.

Notes

Adapted from http://sims.princeton.edu/yftp/gensys/mfiles/qzdiv.m