No BSD License  

Highlights from
Solution to Linear Rational Expectations Models

from Solution to Linear Rational Expectations Models by Pawel Kowal
Solves linear rational expectation models, delivers derivatives of solutions

gsylvester_schur(A,B,C,D,E,F)
function [X,Y, scale, info] = gsylvester_schur(A,B,C,D,E,F)
%  PURPOSE: solves the generalized Sylvester equation:
%
%              A * R - L * B = scale * C            (1)         
%              D * R - L * E = scale * F
%
%       where R and L are unknown m-by-n matrices, (A, D), (B, E) and
%       (C, F) are given matrix pairs of size m-by-m, n-by-n and m-by-n,
%       respectively, with real entries. (A, D) and (B, E) must be in
%       generalized (real) Schur canonical form, i.e. A, B are upper quasi
%       triangular and D, E are upper triangular.
%       0 <= scale <= 1 is an output scaling factor chosen to avoid overflow.
%
%  USAGE: [X,Y, scale, info] = gsylvester_schur(A,B,C,D,E,F)
%  where: 
%         A,B,C,D,E,F               matrices
%
%         X, Y                      matrices solving (1)
%         scale                     scaling parameter
%         info                      = 0: successful exit
%                                   <0: If info = -i, the i-th argument had an illegal value.
%                                   >0: (A, D) and (B, E) have common or close eigenvalues.
%
%   COMMENTS:
%       mex file, gsylvester_schur.dll is required
%       based on Lapack dtgsyl routine
%
% Copyright  (c) Pawel Kowal (2006)
% All rights reserved
% LREM_SOLVE toolbox is available free for noncommercial academic use only.
% pkowal3@sgh.waw.pl

Contact us at files@mathworks.com