Liberty Street Economics

« | Main | »

August 21, 2019

Online Estimation of DSGE Models

The estimation of dynamic stochastic general equilibrium (DSGE) models is a computationally demanding task. As these models change to address new challenges (such as household and firm heterogeneity, the lower bound on nominal interest rates, and occasionally binding financial constraints), they become even more complex and difficult to estimate—so much so that current estimation procedures are no longer up to the task. This post discusses a new technique for estimating these models which belongs to the class of sequential Monte Carlo (SMC) algorithms, an approach we employ to estimate the New York Fed DSGE model. To learn more, check out this paper of ours.


DSGE models are typically estimated with Bayesian techniques. To do so, a researcher represents her or his initial information about the model parameters by a probability distribution (called the prior) and then updates this probability distribution in view of the observed time-series data. This updated distribution is called the posterior. In practice, generating random samples from the posterior distribution is a rather involved endeavor.

Currently, the most widely used method is the so-called random walk Metropolis–Hastings algorithm. It is implemented, for instance, in the popular Dynare software package. While this algorithm has been the bread and butter of Bayesian macroeconometrics for the past twenty years, it has two key disadvantages relevant to central bank applications.

First, it cannot take advantage of parallel computing. Intuitively, Metropolis–Hastings algorithms work by letting one particle (that is, one vector containing all the model’s parameters) travel through the parameter space, spending more time in areas associated with a high posterior probability than in areas associated with a low posterior probability. The algorithm keeps track of all the parameter values visited during this journey and passes this information back to the user.

Because this one particle moves sequentially, and you don’t know where it’s heading (it’s a random walk, after all!), there is no way to get a head start on future computations you will need to perform. This limitation may be tolerable for plain vanilla DSGE models, like the New York Fed’s, where each of these sequential computations takes a negligible amount of computing time. But, if you want to estimate a more complex monetary policy model where households are heterogeneous (like we do at times!), you may find yourself waiting for months (and that’s not fun).

SMC changes the game: instead of sending a single particle to explore the vast expanse of the posterior by itself, you send thousands, and let each particle travel a shorter distance. What’s the advantage? Each particle goes its own way, independently from the others (for the most part). This means that if you have many cores in your parallel computing system (we used the National Science Foundation-funded Extreme Science and Engineering Discovery Environment, or XSEDE for short, and the Dallas Fed’s BigTex cluster), you can allocate each particle to a core and let them all work at the same time. Further, as each particle now travels a far shorter distance, what otherwise might take months can be done in just a few hours! (Note, since you have many more particles, the full posterior is still well-explored.) Divide et impera, as the Latins used to say. This approach has been around in the statistics literature for quite a while (covered by Chopin, among others), but was only recently applied to macroeconometrics (see, for example, this paper by Herbst and Schorfheide, as well as their book).

The second disadvantage of Metropolis–Hastings algorithms is that whenever your data change, or your model is modified slightly, you need to start the estimation over from scratch. If you are in the business of forecasting, as some of us are (see, for example, the latest New York Fed DSGE Model forecast, as well as an assessment of the model’s forecasting performance), this is annoying. Say you have estimated your model with data up to last quarter, and now you have a new quarter of data. As you might imagine, the bunch of particles obtained from the estimation three months ago will still provide a pretty good approximation for the posterior incorporating the newest quarter of data. SMC offers a way out: instead of starting the estimation over, you can simply initialize the old particles from where they left off, and let them travel for a little longer, so as to adapt to the new posterior. This short traveling should not take much time, and is definitely much faster than starting again! This is what we call “online” estimation of DSGE models.

Modifying the SMC algorithm so that you can start from an existing estimation is one innovation of our paper. The other is to make SMC “adaptive” in choosing the speed at which particles travel. Such calibration requires finesse: if your particles travel too fast, the estimation may go haywire; if they travel too slowly, you will waste time. So it is a step forward to be able to adapt the speed of particle movement to how hard a problem is. In this way, online and adaptive estimation naturally go hand-in-hand: when starting from a previous estimation, we can spend more time exploring the distribution when economic conditions are novel than when the data are similar to what the model has already seen. Our algorithm can recognize and handle such situations without any additional input from the user.

In keeping with a tradition of posting our code, the New York Fed DSGE team is sharing the SMC Julia package on Github. Reader, take advantage of our code, and go estimate even harder models than you once dared!


Cai_michaelMichael Cai is a senior research analyst in the Federal Reserve Bank of New York’s Research and Statistics Group.

Edward-p-herbst_rdax_75x86Edward Herbst is a principal economist in the Monetary Affairs Division of the Board of Governors.

Del_negro  marcoMarco Del Negro is a vice president in the Bank’s Research and Statistics Group.

Matlin_ethanEthan Matlin is a senior research analyst in the Bank’s Research and Statistics Group.

Sarfati_recaReca Sarfati is a senior research analyst in the Bank’s Research and Statistics Group.

Frank Schorfheide is a professor of economics at University of Pennsylvania. He received financial support for research described in this post from the National Science Foundation under grant SES 1851634, but has no other relevant or material financial interests related to it.

How to cite this post:

Michael Cai, Edward Herbst, Marco Del Negro, Ethan Matlin, Reca Sarfati, and Frank Schorfheide, “Online Estimation of DSGE Models,” Federal Reserve Bank of New York Liberty Street Economics, August 21, 2019, https://libertystreeteconomics.newyorkfed.org/2019/08/online-estimation-of-dsge-models.html.


Disclaimer

The views expressed in this post are those of the authors and do not necessarily reflect the position of the Federal Reserve Bank of New York or the Federal Reserve System. Any errors or omissions are the responsibility of the authors.

About the Blog

Liberty Street Economics features insight and analysis from New York Fed economists working at the intersection of research and policy. Launched in 2011, the blog takes its name from the Bank’s headquarters at 33 Liberty Street in Manhattan’s Financial District.

The editors are Michael Fleming, Andrew Haughwout, Thomas Klitgaard, and Asani Sarkar, all economists in the Bank’s Research Group.

Liberty Street Economics does not publish new posts during the blackout periods surrounding Federal Open Market Committee meetings.

The views expressed are those of the authors, and do not necessarily reflect the position of the New York Fed or the Federal Reserve System.

Economic Research Tracker

Image of NYFED Economic Research Tracker Icon Liberty Street Economics is available on the iPhone® and iPad® and can be customized by economic research topic or economist.

Economic Inequality

image of inequality icons for the Economic Inequality: A Research Series

This ongoing Liberty Street Economics series analyzes disparities in economic and policy outcomes by race, gender, age, region, income, and other factors.

Most Read this Year

Comment Guidelines

 

We encourage your comments and queries on our posts and will publish them (below the post) subject to the following guidelines:

Please be brief: Comments are limited to 1,500 characters.

Please be aware: Comments submitted shortly before or during the FOMC blackout may not be published until after the blackout.

Please be relevant: Comments are moderated and will not appear until they have been reviewed to ensure that they are substantive and clearly related to the topic of the post.

Please be respectful: We reserve the right not to post any comment, and will not post comments that are abusive, harassing, obscene, or commercial in nature. No notice will be given regarding whether a submission will or will
not be posted.‎

Comments with links: Please do not include any links in your comment, even if you feel the links will contribute to the discussion. Comments with links will not be posted.

Send Us Feedback

Disclosure Policy

The LSE editors ask authors submitting a post to the blog to confirm that they have no conflicts of interest as defined by the American Economic Association in its Disclosure Policy. If an author has sources of financial support or other interests that could be perceived as influencing the research presented in the post, we disclose that fact in a statement prepared by the author and appended to the author information at the end of the post. If the author has no such interests to disclose, no statement is provided. Note, however, that we do indicate in all cases if a data vendor or other party has a right to review a post.

Archives