Transcription of YADA Manual - Computational Details
1 YADA Manual Computational DetailsAnders WarneOctober 26, 2018 Abstract:YADA (Yet AnotherDsgeApplication) is a Matlab program for Bayesian estimation andevaluation of Dynamic Stochastic General Equilibrium and vector autoregressive models. This pa-per provides the mathematical Details for the various functions used by the software. First, somerather famous examples of DSGE models are presented and all these models are included as ex-amples in the YADA distribution. YADA supports a number of different algorithms for solvinglog-linearized DSGE models. The fastest algorithm is the socalled Anderson-Moore algorithm(AiM), but the approaches of Klein and Sims are also covered and have the benefit of being nu-merically more robust in certain situations. The AiM parseris used to translate the DSGE modelequations into a structural form that the solution algorithms can make use of.
2 The solution of theDSGE model is expressed as a VAR(1) system that represents the state equations of the state-spacerepresentation. Thereafter, the different prior distributions that are supported, the state-space rep-resentation and the kalman filter used to evaluate the log-likelihood are presented. Furthermore,it discusses how the posterior mode is computed, including how the original model parameterscan be transformed internally to facilitate the posterior mode estimation. Next, the paper providessome Details on the algorithms used for sampling from the posterior distribution: single block andmultiple fixed or random block random walk Metropolis and slice sampling algorithms, as wellas sequential Monte Carlo. In order to conduct inference based on the draws from the posteriorsampler, tools for evaluating convergence are considered next.
3 We are here concerned both withsimple graphical tools, as well as formal tools for single and parallel chains. Different methods forestimating the marginal likelihood are considered thereafter. Such estimates may be used to eval-uate posterior probabilities for different DSGE models. Various tools for evaluating an estimatedDSGE model are provided, including impulse response functions, forecast error variance decom-positions, historical forecast error and observed variable decompositions. Forecasting issues, suchas the unconditional and conditional predictive distributions, are examined in the following sec-tion. The paper thereafter considers frequency domain analysis, such as a decomposition of thepopulation spectrum into shares explained by the underlying structural shocks. Estimation of aVAR model with a prior on the steady state parameters is also discussed.
4 The main concerns are:prior hyperparameters, posterior mode estimation, posterior sampling via the Gibbs sampler, andmarginal likelihood calculation (when the full prior is proper), before the topic of forecasting withBayesian VARs is considered. Next, the paper turns to the important topic of misspecification andgoodness-of-fit analysis, where the DSGE-VAR framework is considered in some detail. Finally, thepaper provides information about the various types of inputthat YADA requires and how theseinputs should be :Copyrightc 2006 2018 Anders Warne, Forecasting and Policy Modelling Division, European CentralBank. I have received valuable comments and suggestions by past and present members of the NAWM team: KaiChristoffel, G nter Coenen, Jos Emilio Gumiel, Roland Straub, Michal Andrle ( esk N rodn Banka, IMF), JuhaKilponen (Suomen Pankki), Igor Vetlov (Lietuvos Bankas, ECB, Deutsche Bundesbank), and Pascal Jacquinot, as wellas our consultant from Sveriges Riksbank, Malin Adolfson.
5 Aspecial thanks goes to Mattias Villani for his patiencewhen trying to answer all my questions on Bayesian have also benefitted greatly from a course given byFrank Schorfheide at the ECB in November 2005. Moreover, I amgrateful to Juan Carlos Mart nez-Ovando (Bancode M xico) for suggesting the slice sampler, and to Paul McNelis (Fordham University) for sharing his dynare codeand helping me out with the Fagan-Lothian-McNelis DSGE example. And last but not least, I am grateful to MagnusJonsson, Stefan Las en, Ingvar Strid and David Vestin at Sveriges Riksbank, to Antti Ripatti at Soumen Pankki, andto Tobias Blattner, Boris Glass, Wildo Gonz lez, Tai-kuangHo, Markus Kirchner, Mathias Trabandt, and Peter Welzfor helping me track down a number of unpleasant bugs and to improve the generality of the YADA code.
6 Finally,thanks to Dave Christian for the Kelvin Introduction .. 102. DSGE The An and Schorfheide A Small Open Economy DSGE Model: The Lubik and Schorfheide Example .. A Model with Money Demand and Money Supply: Fagan, Lothian andMcNelis .. A Medium-Sized Closed Economy DSGE Model: Smets and Wouters .. The Sticky Price and Wage Equations .. The Flexible Price and Wage Equations .. The Exogenous The Steady-State Equations .. The Measurement Equations .. Smets and Wouters Model with Stochastic Detrending .. A Small-Scale Version of the Smets and Wouters Model .. The Smets and Wouters Model with Financial Frictions .. Augmented Measurement Equations.. The Steady-State in the Smets and Wouters Model with Financial Preliminaries: The Log-Normal Steady-State Elasticities.
7 The Smets and Wouters Model with Unemployment .. The Leeper, Plante and Traum Model for Fiscal Policy The Log-Linearized Dynamic Equations.. The Steady-State Equations .. Measurement Equations.. 383. Solving a DSGE The DSGE Model Specification and Solution .. The Klein The Sims Approach .. Solving a DSGE Model Subject to a Zero Lower Bound Constraint.. The Zero Lower Bound .. Anticipated Solving the DSGE Model with the Klein Policy Rate Projections and the Complementary Slackness Condition.. The Forward-Back Shooting Algorithm .. Stochastic Simulations .. A Structural Form Representation of the Zero Lower Bound Solution .. YADA Code .. 544. Prior and Posterior Distributions .. Bayes Theorem .. Prior Distributions.
8 Monotonic Functions of Continuous Random The Gamma and Beta Gamma, 2, Exponential, Erlang and Weibull Distributions .. Inverted Gamma and Inverted Wishart Distributions.. Beta, Snedecor (F), and Dirichlet Distributions .. Normal and Log-Normal Distributions.. 63 2 Left Truncated Normal Uniform Student-tand Cauchy Distribution .. Logistic Distributions .. Gumbel Distribution .. Pareto Distribution.. Discussion .. Random Number System YADA Code .. 755. The kalman filter .. The State-Space Representation .. The kalman filter Recursion .. Initializing the kalman The Likelihood Function .. Smoothed Projections of the State Variables .. Smoothed and Updated Projections of State Shocks and Measurement Errors.
9 Multistep Forecasting .. Covariance Properties of the Observed and the State Computing Weights on Observations for the State Weights for the Forecasted State Variable Projections .. Weights for the Updated State Variable Projections .. Weights for the Smoothed State Variable Simulation Smoothing .. Chandrasekhar Recursions .. Square Root Filtering .. Missing Observations .. Diffuse Initialization of the kalman Diffuse kalman Diffuse kalman Smoothing .. 94 3 A Univariate Approach to the Multivariate kalman Univariate Filtering and Smoothing with Standard Initialization.. Univariate Filtering and Smoothing with Diffuse Initialization .. Observation Weights for Unobserved Variables under Diffuse Initialization .. Weights for the Forecasted State Variables under Diffuse Initialization.
10 Weights for the Updated State Variable Projections under Diffuse Initialization . Weights for the Smoothed State Variable Projections under Diffuse YADA Code .. (Ht).. (Ht) .. (Ht) .. (Ht).. (Ht) .. (Ht).. (Ht).. (Ht) .. (Ht) .. (Ht).. (Ht) .. (Ht).. (Ht) .. (Ht).. (Ht) .. (Ht) .. (MO)(Ht).. (MO)(Ht).. (MO)(Ht).. (MO)(Ht).. (MO)(Ht).. (MO).. 1096. Parameter Transformations .. Transformation Functions for the Original Parameters .. The Jacobian Matrix .. YADA Code .. Computing the Posterior Mode .. Comparing the Posterior Modes .. Checking the Optimum.. A Monte Carlo Based Optimization YADA Code .. System Prior File.. 4 *..1218. Posterior Sampling .. The Random Walk Metropolis Algorithm .. Student-tProposal Density.