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)) > stakeare 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:
- stake
float Largest positive value for which an eigenvalue is considered stable.
- A
np.ndarray Upper-triangular matrix.
- B
np.ndarray Upper-triangular matrix.
- Q
np.ndarray Matrix of left Schur vectors.
- Z
np.ndarray Matrix of right Schur vectors.
- stake
- Returns:
tupleofnp.ndarrayA, 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