Solving Linear Rational Expectations Models

The files starting linre3a are the paper.


The mfiles directory contains two matlab files, gensys.m and gensysct.m, that analyze linear rational expectations systems and return solutions for their dependence on exogenous disturbances. The systems need not have non-singular lead matrices (coefficients on current variables in discrete time, on derivatives in continuous time) and they need not be well-specified. The program analyzes them to determine whether solutions exist and whether they are unique. It returns a solution even when it is not unique, and it returns a solution that constrains exogenous variable behavior when no solution that does not do so exists.

The continuous time program, unlike the discrete time program, handles only the case of serially uncorrelated exogenous processes.

The files qzdiv.m, qzdivct.m, and qzswitch.m are required by the gensys.m programs. If you try to implement the algorithm in non-Matlab languages, you will need to find or write a routine that does the complex QZ (or generalized Schur) decomposition. Fortran routines that do this are available in the ACM algorithm files or LAPACK.


A newer edition of gensys, with some improvements (though possibly with still an unknown bug or two --- please report any you find --- is available in the R subdirectory. This version of the program is written in R, the open source version of S. It should run directly on any Suse 9-10 linux system and with very minor change (in the line in qz.r giving the location of the library file) on any unix system. It probably will also work on Windows systems where lapack is available as a .dll file, but I haven't tried this.

R is available from


Octave is an open-source program that is largely compatible with Matlab. However, some functions with the same name as corresponding Matlab functions return different values. The qz function is one of these, unfortunately. It transposes one of q or z, relative to what matlab returns as q or z. Furthermore, it does only the real generalized Schur decomposition, which will be enough for some models, but not for all. James Murray (jmmurray at has provided a version of gensys that works in octave. It requires that you compile a new version of the qz command from C and Fortran code. On Unix machines at least, this is very straightforward and is explained in the zip file.

Chris Sims

Eastern Time

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[TXT]HEADER.html2010-11-18 17:00 4.6K 
[   ]LINRE3A.aux2010-11-18 17:00 6.6K 
[   ]LINRE3A.bbl2010-11-18 17:00 1.7K 
[   ]LINRE3A.blg2010-11-18 17:00 140  
[   ]LINRE3A.dvi2010-11-18 17:00 109K 
[   ]LINRE3A.pdf2010-11-18 17:00 150K 
[TXT]LINRE3A.tex2010-11-18 17:00 70K 
[   ]Linre3a.ps2010-11-18 17:00 457K 
[DIR]Octave/2024-01-21 12:39 -  
[DIR]Rfiles/2024-01-21 12:39 -  
[DIR]mfiles/2024-01-21 12:39 -  

Apache/2.4.52 (Ubuntu) Server at Port 80