TOM.M: ====== %This files produces table 2 of mono.tex. Table 2 contains second moments implied by the Ramsy allocation. %Input: markup MU %Output a table and its TEX readable version. %The colums of the table are: mean, std, acorr, corr(x,y), corr(x,g), and corr(x,z) %The rows are tau, pi, R, y, h, c. %Calls: simu.m and moments.m SIMU.M ======= %function [tau,R,y,h,c,pai,g,z,TM]=simu(state0,MU) computes Ramsey allocations for a given state of the economy (state0) and a given markup (MU). It also provides the processes for the exogenous gov't purchases (g) and technology (z) shocks and the state transition matrix of these shocks, TM. Note that for tau, R, y, h, c, g, and z, the stochastic process is defined by 4 numbers, one corresponding to each possible state of the economy. The process pai is given by a 4x4 matrix because both the previous and current states are relevant in determining this variable. %Inputs: state0 and MU (respectively, the state of the economy and the markup) %Output: Ramsey equilibrium processes for: tau (labor income tax rate),R (nominal interest rate), y (output),h (hours), c (consumption), pai (inflation). The exogenous processes g (vog't purchases) and z (technology shock), and the state transition matrixTM. %Calls: L.m, param.m, findvh.m (via fsolve) MOMENTS.M ========== %function y=moments(x,y,g,z,TM) computes second moments of the variable x. Specifically, it computes mean, std, acorr, corr(x,y), corr(x,g), and corr(x,z). %Inputs: The stochastic processes x, y, g, and z, and the transition matrix TM. Note that the stochastic process of each variable is given by just 4 numbers, one for each possible state of the economy. %Output: y, a vector containing the moments listed above. MOMPAI.M ========== %function y = mompai(pai,y,g,z,TM) computes second moments of pai. Specifically, it computes mean, std, acorr, corr(pai,y), corr(pai,g), and corr(pai,z). %Inputs: The stochastic processes pai, y, g, and z, and the transition matrix TM. Note that the process pai is given by a 4x4 matrix because both the previous and current states are relevant in determining this variable. %Output: y, a vector containing the moments listed above. L.M ==== %LAMBDA = L(state0,MU) computes the equilibrium value of LAMBDA, the multiplier in the implementability constraint of the Ramsey problem. %Inputs: state0 (the state of the economy) and MU (the markup) %Output: LAMBDA and DIST (the output of findL, see below) %Calls: findL.m (via fsolve.m) PARAM.M ======== %function [BETA,THETA,D,ETA,B,A,gl,gh,phig,zl,zh,phiz,ALFA,TM]=param(MU1) computes the parameters of the model %Input: MU (the markup) FINDVH.M ========= %y = findvh(vh,LAMBDA,G,Z,MU,P0) evaluates the first-order conditions of the Ramsey problem w.r.t. v and h. These focs are solved with fsolved in the program simu.m %Inputs: vh (a 2-element vector containing values for v and h), LAMBDA (the multiplier in the implementability constraint of the Ramsey problem), G and Z, the values taken by the exogenous gov't purchases and techno shocks, and P0, an indicator variable taken the value 1 if the period is 0 and zero otherwise. %Output: y (a 2-element vector showing how far from zero the focs are, zero being the solution) FINDL.M ======== %y = findL(LAMBDA,state0,MU) evaluates the implementability constraint of the Ramsey problem. A solution to this costraint is reached when y=0. This program is used by L.m, which searches for a value of LAMBDA that makes y=0. %Inputs: LAMBDA (the lagrange multiplier of the implementability constraint in the Ramsey problem), state0 (the initial state of the economy), and MU (the markup). %Output: y, the value taken by the implementability constraint (0 is a solution) %Calls: param.m, findvh.m (c) Stephanie Schmitt-Grohe and Martin Uribe