Back to top anchor
Working paper

An Efficient Application of the Extended Path Algorithm in Matlab with Examples (WP 22/02)

Issue date: 
Thursday, 21 July 2022
Corporate author: 
View point: 
Document Date: 
Thursday, 21 Jul 2022
Publication category: 
JEL classification: 
C53 - Forecasting Models; Simulation Methods
C61 - Optimization Techniques; Programming Models; Dynamic Analysis
C63 - Computational Techniques; Simulation Modeling
E37 - Prices, Business Fluctuations, and Cycles: Forecasting and Simulation: Models and Applications
E47 - Money and Interest Rates: Forecasting and Simulation: Models and Applications


Recent experience with interest rates hitting the effective lower bound and agents facing binding borrowing constraints has emphasised the importance of understanding the behaviour of an economy in which some variables may be restricted at times. The extended path algorithm is a commonly used and fairly general method for solving dynamic nonlinear models with rational expectations. This algorithm can be used for a wide range of cases, including for models with occasionally binding constraints, or for forecasting with models in which some variables must satisfy a certain path. In this paper I propose computational  improvements to the algorithm that speed up the calculations via vectorisations of the Jacobian matrix and residual equations. I illustrate the advantages of the method with a number of policy relevant applications: conditional forecasting with both exactly identified and  underidentified shocks, occasionally binding constraints on interest rates, anticipated shocks, calendar-based forward guidance, optimal monetary policy with a binding constraint and transition paths.


The views, opinions, findings, and conclusions or recommendations expressed in this Working Paper are strictly those of the author(s). They do not necessarily reflect the views of the New Zealand Treasury or the New Zealand Government. The New Zealand Treasury and the New Zealand Government take no responsibility for any errors or omissions in, or for the correctness of, the information contained in these working papers. The paper is presented not as policy, but with a view to inform and stimulate wider debate.


I’d like to thank Mariano Kulish, Murat Özbilgin and Christie Smith for their useful comments. All remaining errors (if any) are my own.

Last updated: 
Thursday, 21 July 2022