Home
DSGE: User Guide
Contents
1. To accomplish this the procedure SYS must contain the command if _eqno 0 retp fx else retp fx _eqno endif before the endp statement Different from DSGE_LA the procedure SYS receives w x y Z X y Z as argument 4 4 Solution Algorithm The first step in the computation of the solution is similar to the linear approximation For this reason you can use DSGE_QA also to obtain a linear approximate solution of your model To accomplish this set the global control variable _linear equal to 1 From the Jacobian matrix of 4 1 the program derives X4 BE Pg At X At A CZ 4 3 where X x xX and A 4 A Z is always equal to z The matrices A B and C are functions of the model s parameters The linear part of the feed back rules is computed via the generalized Schur factorization of B A Therefore you will get the same error messages as in the linear case if the factorization fails if the conditions on the eigenvalues are not satisfied or if complex coefficients appear in the solution The quadratic part of the feed back rule for x44 or yz is given by 1 d 5 z o Hi z oO where the matrix H depends on the parameters of the first and second derivatives of 4 1 Again if z instead of z is governed by 4 2 then z is an argument of the quadratic feed back rule 5 Output Options The program provides two output options e if _IR 1 impulse responses
2. are within the unit circle and n A of the eigenvalues are outside the unit circle If this condition is not met the program stops with an error message You will also get error messages if e the program is not able to obtain a factorization of B A e if the program detects complex coefficients in L2 L2 L or L In both cases the computed solution will be misleading and you should check your program 3 5 Additional Variables Occasionally you may want solutions for variables that can not be included in u or Az For instance in the benchmark model consider E A From the linear solution AA S Ag Liit L you get Esi Ey 23841 Lla LA L2a L2 LYE 12 e AL7 LAL LMI amp Therefore you can determine EA as a linear function of and 2 with matrices B iL LY TAL LN Note that the program must compute the linear solution before it can determine LY and LY For this reason you must input the two matrices after the statement include SolveLA2 src in the file DSGE_LA 4 Quadratic Approximation 4 1 Structure of the Model The quadratic approximate solution of the model is implemented in DSGE_QA Since it rests on numeric second derivatives you always have to specify the equations of your model The program distinguishes between three types of variables e State variables see above are collected in the vector x e variables wi
3. are stored in the n z vector Zt Let E denote expectations as of period t The model can then be summarized by the n u equations ope An z 0 i 1 2 n u 3 1 the n x n A equations Eh Ut Xt t Zt Utt Xip Aes Pi 0 i 1 2 n z n A 3 2 and the system of n z equations Zey1 Ute E E N Onc aivetts x 3 3 where N ys X denotes the multivariate normal distribution with mean vector js and covariance matrix Usually the shocks in z will not follow the vector autoregressive process 3 3 then we assume that the percentage deviations of the variables in Z Zit from their uncon ditional means 2 i e Zit Fi Zn T t l2 N2 are governed by 3 3 3 2 Example The stationary variables of the benchmark business cycle model from Section 1 5 1 of Heer and Mau ner 2009a are the capital stock per efficiency unit k output consumption and investment per efficiency unit Y C and i respectively working hours N the rental rate of capital r the real wage per efficiency unit of labor w the level of total factor productivity Z and the scaled Lagrange multiplier of the household s budget constraint A Thus e X kt e At At eu Yi Ce it Pe We Ne 3 e z ln Z The system of equations 3 1 is o Q0 N A 0O c 1 NAPOTI Aws 0 r a Zi NEk 0 w 1 a ZN k 0 yi ZNE ke O y C whe
4. A is designed as a shell where you must input your model determine the solution method and choose the output options After you have input your code you should save this file under a different name so that you will be able to use the original file for other models The use of DSGE_ g is illustrated with the benchmark business cycle mode of Hansen 1985 as described in Heer and Maufner 2009a Section 2 6 1 You should run these files to check your installation 3 Linear Approximation 3 1 Structure of the Model Solutions of DSGE models that build on a linearized version of the model are imple mented in DSGE_LA g We distinguish between four types of variables e State variables these are variables that have given initial conditions as for instance the stock of capital or the level or nominal money balances They are stored in the n x vector x where t denotes time e Costate variables these are variables without initial conditions as for instance the Lagrange multiplier of the household s budget constraint They are stored in the n A vector Az e Control variable these are variables without initial conditions that can be deter mined from the given values of the state and costate variable as for instance output and working hours They are stored in the n u vector uz e Shock variables these are variables that follow given stochastic processes as for instance the level of total factor productivity They
5. DSGE User Guide Alfred Mau8ner 17 July 2010 Contents 1 Introduction 1 2 Installation 2 3 Linear Approximation 2 3 1 Structure of the Model 0 000000000000000000 2 3 2 Example ne ke ae de ee Se oe Bee a Ce ES AS A A 3 3 0 Linearization 2 2 lt 25 625 o26 4850268 amp oe eK ERE 4 3 4 Solution Aloo ss seres dms smir RESEDA EE DR 5 3 5 Additional Variables aaoo a a a a a a 6 4 Quadratic Approximation 6 4 1 Structure of the Model aaa aa a a a a 6 AD Examples see iiie auk i Se nd E a E ba ce He Be e Oe i T 4 3 Derivatives sp sa acs p s s adp Ea 2 adr p a aa e a aa a aa a A ri 4A Solution Algorithm sve c s srei BAe ok WA N K e e RE AE R 8 5 Output Options 8 6 Summary of Global Control Variables 11 7 References 12 1 Introduction The Gauss program DSGE provides a framework for solving DSGE models along the lines of Heer and Mau ner 2009a Chapter 2 and Heer and Mau ner 2009b Its aim is to allow less experienced users of Gauss to solve and simulate their model using either linear or quadratic approximations of the model s equilibrium conditions I assume that you are familiar with dynamic stochastic equilibrium models and in particular with perturbation methods that obtain approximate solutions of these models I also assume that you know how to start the Gauss software under the Windows operating system and that you have a basic knowledge of the Gauss syntax In this document I use the typewr
6. iter font to print Gauss commands and file names Vectors are typeset in boldface e g x denotes a vector of n x elements 1 2 Installation The code of DSGE is stored in various files The files with the src extension contain source code that the user should not change Gauss will look for these files in its src subdirectory For instance if c gauss is the directory where Gauss is installed then copy the files to this directory You may also wish to use a different directory In this case you must append the src_path variable in the file Gauss cfg with the path to the directory where you want to store the src files Yet a third possibility is to copy the files in the working directory that you use for your project This directory can be accessed via the working directory button or by executing the command chdir path from the Gauss command window where path is the path to this directory The file Tools d1l must be placed in the Gauss dlib subdirectory for instance in c Gauss dlib if Gauss is installed in c Gauss This dynamic link library con tains routines written in Fortran that implement the Schur and the generalized Schur factorization of matrices In order to use this library you also have to install the file DFORRT d11 in the system32 subdirectory of your Windows 32 bit operating system i e in c windows system32 or in the SysWOW64 subdirectory of your Windows 64 bit system The file DSGE_ g where either equals LA or Q
7. om Trend 0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20 Period Period 1 4 1 0 Real Wage User Costs of Capital 0 6 Hours Capital Stock 0 2 Percentage Deviation from Trend Percentage Deviation from Trend 0 2 0 6 0 0 ie 2 4 6 8 10 12 14 16 18 20 ie 2 4 6 8 10 12 14 16 18 20 Period Period The output of the program is further controlled by a Gauss structure There are as many instances of this structure as there are variables in your model For each variable for which you want to obtain either graphics or printed output your program must contain the following lines of code 1 Var 1 varname Output 2 Var 1 vartype u 3 Var 1 varpos 5 a Var 1 varprint 1 5 Var 1 relsx 1 6 Var 1 crosscorr 1 7 Var 1 varplot 1 s Var 1 plotno 1 In this example Var 1 refers to the first instance of the structure Var This instance stores information on the variable named Output This variable is a member of the vector u In DSGE_LA the structure member vartype can be assigned the strings u x 1 if the variable belongs to the vector A z or y In DSGE_QA accepted strings are x y and z In the example output is the fifth variable in the vector u see line 10 3 In lines 4 7 the assignment of 1 stands for true and 0 for false Thus varprint 1 tells the program that you want information on the second moments of the variable output to be printed
8. re n 0 and a are parameters of the model These equations determine the variables in u given ky A and Z The model s dynamics from 3 2 is governed by 0 aku 1 ki it 0 A Ba EA 1 64 rea where a and are also parameters of the model Finally with EZ Z 1 In Z Z 1 1 evolves according to Zt41 0 F 441 N 0 0 3 3 Linearization The model in 3 1 and 3 2 is linearized at the stationary solution of the deterministic counterpart of the model which is obtained from 3 1 and 3 2 in the following steps Step1 Replace z by its unconditional mean z so that the expectations operator E can be ignored Step2 Assume stationarity i e drop the time index from all variables Step3 Solve 0 g u x Z h Zenu for u x and A Let a x x denote the percentage deviation of a variable from its stationary solution x In terms of these variables the log linearized model can be written as CH O4 0 eos 3 4a t o 3i g oe x Dz Ey 4 Fra a Dy Egy Ft DBZ FZ 3 4b Atti At Lt H Et e amp N O x 3 4c You can either derive this structure using paper and pencil or input the equations 3 1 and 3 2 and let the program determine the matrices in 3 4a and 3 4b In the first case you must set the variable _equations equal to zero and input the non zero elemen
9. s1 the number of periods in each impulse response DSGE_LA DSGE_QA _nobs the length of simulated time sereis DSGE_LA DSGE_QA _nofs the number of simulations DSGE_LA DSGE_QA _HPL the filter weight of the HP filter if equal to 0 the HP filter will not be applied DSGE_LA DSGE_QA _scale 1 all graphic panels share the same scale DSGE_LA DSGE_QA _color 1 colored impulse responses are plotted DSGE_LA DSGE_QA _LoadShocks 1 the program uses random numbers from the file eps_array fmt DSGE_LA DSGE_QA _MakeShocks 1 the program draws random numbers and stores them in the file eps_array fmt in the current Gauss working directory DSGE_LA DSGE_QA _outfile string variable the name of the output file 11 7 References Hansen Gary D 1985 Indivisible Labor and the Business Cycle Journal of Monetary Economics Vol 16 309 327 Heer Burkhard und Alfred Maufner 2009a Dynamic General Equilibrium Model ing Springer Berlin Heer Burkhard und Alfred Maufner 2009b Computation of Business Cycle Mod els with the Generalized Schur Method Indian Growth and Development Re view Vol 2 173 182 12
10. stematic differences with random ones In this case use _loadShocks 1 The program will look for a file eps_array fmt in the current working directory To create this file for your settings of nobs nofs and _nz the number of shocks in your model uses _MakeShocks 1 once and set this variable equal to 0 in all other runs of your program If required you can pass the time series through the Hodrick Prescott filter see Heer and Maufner 2009 Section 12 4 In this case assign the filter weight e g 1600 to the variable _HPL If _HPL 0 the program does not filter the data Impulse responses are computed and plotted for each element of z The graphic files that store the plots are saved in files named Figure tkf where is the number of the element z i 1 2 n z in the current working directory of Gauss Each plot can consist of up to six panels graphic windows in which you can plot the impulse responses of the variables of your model see Figure 5 1 There are two other options that determine the way impulse responses are plotted If scale 0 each graphics window will be scaled individually For _scale 1 the same scale will be applied to all panels Impulse responses will be colored if _color 1 otherwise black lines will be used Figure 5 1 Impulse Responses from the Benchmark Business Cycle Model Output TFP Shock Consumption Investment Percentage Deviation from Trend Percentage Deviation fr
11. thout given initial conditions are collected in the vector yz e and the model s shocks in the vector z The model is summarized in the n x n y equations Esg Xt Yi Ze X41 Ytri Z1 0 1 1 2 n x nly 4 1 and the transition equation for the shocks Z1 zy Et 4 2 E41 TAN Niyi N Onc In z Note that 4 2 implies that the mean of z is 0 Thus if the shocks in your model have mean z On you must replace z by Z in equations 4 1 and 4 2 6 4 2 Example In order to apply the quadratic solution to the benchmark business cycle model we collect its variables in ex ki e yt Yt Ct it Tt We Me Ad e z ln Z The system of equations 4 1 is 0 47 1 N O t c 1 N 2 Aw 0 r AZN hr 0 w 1 a ZN ke 0 yi ZNI kS 0 Yy tit Gi 0 ak 1 ki it 0 Ba E 1 ria The parameters of 4 2 are o o and Q 1 4 3 Derivatives The program computes first and second derivatives of the system 4 1 at x y z that solve g x y Z x y z 0 i 1 2 n x n y In DSGE_QA you must provide both the system of equations 4 1 and the stationary solution of the model The stationary values must be stored in the vectors _xstar _ystar and _zstar Remember that z 0 z x1 so that _zstar always has to be a vector of n z zero elements The second derivatives are computed for each equation in 4 1
12. to the file specified in the variable outfile Without any further information the program prints the standard deviation of this variable and its first order autocorrelation If you also set relsx and crosscorr to true the output table has two additional columns that show the standard deviations of other variables relative to the standard deviation of output and the cross correlations of other variables with output In line 7 and 8 you tell the program to print the impulse response of output to the graphics panel 1 Accepted values for plotno are the integers 1 through 6 Finally you may want to overwrite the program s automatic positioning of plot legends In this case you must edit the global variable _plegend If you want to change the lower left corner of the legend in panel 7 of figure 7 to the plot coordinates x y type 1 _plegend j i 1 x 2 _plegend j i 2 y 6 Summary of Global Control Variables File Variable Possible Settings and Effect DSGE_LA _GSchur 1 the generalized Schur factorization will be used DSGE_LA _equations 1 the program expects the equations of your model in Sys1 and Sys2 DSGE_QA _linear 1 the program computes only linear feed back rules DSGE_LA DSGE_QA _Moments 1 the program computes second moments DSGE_LA DSGE_QA _confidence 1 the program computes and prints 95 percent intervals for the simulated moments DSGE_LA DSGE_QA _IR 1 the program computes and plots impulse responses DSGE_LA DSGE_QA _nob
13. ts of the matrices Cu Cra Cz Dz Fr Du Fu Dz and F In the second case put _equations 1 and supply the equations 3 1 and 3 2 in the Gauss procedures Sys1 and Sys2 respectively Note that df Inz f Therefore the input to Sys1 and Sys2 are the natural logarithms of the variables not the levels of the variables Therefore Sys1 and Sys2 must contain the statement w exp w where w u x A z As a final step you must input the matrices II and from equation 3 4c 3 4 Solution Algorithm Internally the program reduces 3 4 to the system a BE lt Atti Xr f Ch 3 5 t where B Dax Du Cox A Fax F Cy C2 C D D C C I F FaC3 Ch If the matrix B is invertible which will usually be the case if you correctly specify 3 1 and 3 2 you can use the Schur factorization of W B A to obtain linear feed back rules of the form Kip Lox L2 DER LY 3 6 Ai L s Ie In this case set the global control variable _GSchur equal to zero If B is not invertible something you will at least get to know if the program stops with an error message and if you are sure that your matrices or your equations are correctly specified you can use the generalized Schur factorization to compute the feed back rules 3 6 The program will be able to compute a solution if n x of the eigenvalues of B 1A or of the matrix pencil B A
14. will be computed and plotted e if _Moments 1 second moments obtained from simulations of the model will be computed and printed to the file you specify in the string on the right of the command outfile summary txt e if _confidence 1 the program computes and prints 95 percent intervals for the simulated moments For instance the program s graphic output for the benchmark business cycle model may look like Figure 5 1 and the printed output could be as presented in Table 5 1 The number of periods considered in the computation of impulse responses is stored in the variable nobs1 Second moments are computed as average over nofs simula tions of the model where each simulation computes times series of length nobs The Table 5 1 Second moments from simulated data Output 1 44 1 00 1 00 0 65 Consumption 0 56 0 39 0 99 0 66 Investment 6 13 4 26 1 00 0 64 Hours 0 77 0 54 1 00 0 64 Real Wage 0 67 0 47 0 99 0 66 Rental Rate of Capital 1 48 1 03 0 98 0 64 Column 1 Variable name Column 2 Standard deviation Column 3 Standard deviation relative to standard deviation of Output Column 4 Cross correlation with Output Column 5 First order autocorrelation simulations rest on draws of random numbers If _loadShocks 0 the program draws pseudo normal distributed random numbers for each simulation If you want to com pare different versions of your model you may want to use the same set of random numbers in order not to confuse sy
Download Pdf Manuals
Related Search
Related Contents
Kentucky Health Benefit Exchange Contact Center RAISE Tool User Guide Démarrage rapide manuale d`uso - AS Solar Italia Mobilis Messenger 15.4" A.O. Smith EQ 380 G Installation and Use Manual USER MANUAL Linksys NULL WET11 User's Manual microKEY-37/61 Owner's manual Copyright © All rights reserved.
Failed to retrieve file