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

[P,R,eig]=solve_deterministic(A,B,xi,do_reduction,method)
function [P,R,eig]=solve_deterministic(A,B,xi,do_reduction,method)
%  PURPOSE: finds matrices P,R such that
%
%               AR = BRP
%
%           satisfying transversality condition
%               lim (t->infty) xi^tRP^t = 0
%
%           matrix pair (A,B) must be regular
%
% ---------------------------------------------------
%  USAGE: [P,R,eig] = solve_deterministic(A,B,xi,do_reduction,method)
%  where: 
%         A,B                       quadratic matrices, such that the
%                                   matrix pair (A,B) is regular
%         xi                        growth restriction
%         do_reduction              optional parameter, if do_redution~=0,
%                                   then the orginal problem is reduced first
%         method                    method to calculate null spaces
%                                   (optional)
%                                       1 - qr with pivoting (default)
%                                       2 - svd
%
%         P,R                       matrices
%         eig                       eigenvalues
%
%   COMMENTS:
%
% Copyright  (c) Pawel Kowal (2006)
% All rights reserved
% LREM_SOLVE toolbox is available free for noncommercial academic use only.
% pkowal3@sgh.waw.pl

if nargin<4
    do_reduction                    = 1;
end
if nargin<5
    method                          = 1;
end

if do_reduction
    [A,B,Q]                         = model_reduction(A,B,method);
else
    Q                               = 1;
end

[U,V,TA,TB,n,eig]                   = schur_ord(A,B,xi);
P                                   = TB(1:n,1:n)^-1*TA(1:n,1:n);
R                                   = Q*V(:,1:n);

Contact us at files@mathworks.com