Macroeconomic Theory Temple University Econ 607 Fall 1997 C. Swanson HW 4 This homework is about computing the behavioral functions in a Real Business Cycle Model (RBC). This steps consist of (1) solving for the steady state; (2) writing the first order conditions (FOC's) as linear approximations of percentage deviations of the state variables (capital k and technology a) from their steady state values; (3) solving the system. The utility function is the standard constant relative risk aversion (CRRA) utility function and production is via the Cobb-Douglas. These are written into the code below. Replicate this code and execute it to answer the following questions. At some points small modifications are necessary. 1. Find the steady state values for c, k and n for gam = ngam =1.5 and for gam = ngam = 0.8. The procedure for the first case is given here. (* The utility function. *) u[c_,l_]=(c^(1-gam))/(1-gam)+b(l^(1-ngam))/(1-ngam); (* An abbreviation for it. *) ut=u[c,l]; (* This form obviates the need for writing the arguments.*) (* The production function. *) F[k_,n_,a_]:=a k^alpha n^(1-alpha); f:=F[k,n,a]; (* Notice. When you take a derivative of the production function, you have two choices. The marginal product of capital is MPK = D[F[k,n,a],k] and MPK = D[f,k] The second one is shorter. However, if you switch these and try MPK = D[F,k], you will get zero instead of the true derivative. *) (* There are two FOCs. u'(c) = B E[u'(c(t+1)(F'+1-del)] u sub l/u sub c = F sub n *) (* Finding the Steady state solution. *) (* Specs *) beta=.96;gam=1.5;ngam=1.5;b=2; (* Preferences *) delta=.08;alpha=.25;gam=1.5;ngam=1.5;b=2; rho=0.95; (*Production*) (* A(t+1) - A = rho(A(t) - A) + e(t+1) *) (* The 2 FOC's and Feasibility: *) s1:={beta(D[f,k]+1-delta)==1}/.{a->1}; s2:={(D[ut,l]/D[ut,c]==D[f,n])/.{l->1-n,a->1}}; s3:={F[k,n,1]==c + delta k}; s0=Join[s1,s2,s3]; (* Getting the steady state state solution. Note that an initial guess is needed. *) Timing[sol1=FindRoot[s0,{c,.3},{k,1},{n,.3}]] {0.05499999999969419*Second, {c -> 0.3876078471195834, k -> 0.953134050294058, n -> 0.364862687635777}} (* Setting the steady state values. *) cbar=c/.sol1; kbar=k/.sol1; nbar=n/.sol1; abar=0; 2. Set up the RBC system for gam = ngam = 1.5 and gam = ngam = 0.8. The first case follows below. (* We will have initially 4 equations. These will be of the form m1 = {f1==f2} m2 = {f3==f4} m3 = {f5==f6} m4 = {f7==f8} (m1 and m2 are the FOC's. m3 is K(t+1) = K(t)(1-del) +I(t) and m4 is Y(t) = F(k,n,a) = C(t) + I(t) ). Later we can add complications, like taxes, government spending, a foreign sector, more goods and capital types. *) f1:= (D[ut,c,c]c c1+D[ut,c,n]n n1)/.{c->cbar,n->nbar}; h2[c_,k_,n_]:=beta(D[ut,c])((D[f,k])+1-delta); (* This is the rhs. of the FOC. *) f2:=(D[h2[c,k,n],c]c c2+D[h2[c,k,n],k]k k2+ D[h2[c,k,n],n]n n2)/.{c->cbar,k->kbar,n->nbar}; (* Lin. approx. of h2. *) h3[c_,l_]:=(D[ut,l]/D[ut,c]); (* h3 = MRS *) f3:=(D[h3[c,l],c]c c1-D[h3[c,l],l](1-l) n1)/.{c->cbar,l->1-nbar}; (* Lin. approx. of h3. *) f4:=(D[f,n,n]n n1+D[f,n,k]k k1+D[f,n,a]a a1)/. {k->kbar,n->nbar,a->abar}; (* Lin. approx. of the real wage (the MPL). *) f5:=k2; f6:=k1(1-delta)+delta kbar i1; f7:=(D[f,k]k k1+D[f,n]n n1+D[f,a]a a1)/. {k->kbar,n->nbar,a->abar}; (* Lin. approx. of output. *) f8:=(cbar c1+delta kbar i1); (* Lin. approx. of C(t) +I(t) *) Clear[m1,m2,m3,m4] (* Clear, as a precaution only. *) m1:={f1==f2}/.{a->1}; (* We set tech. (a) now, not earlier, *) m2:={f3==f4}/.{a->1}; (* because we took some derivatives *) m3:={f5==f6}; (* of f w.r.t. a while a was/is and arg. *) m4:={f7==f8}/.{a->1}; (* of f. *) (* Setting the percent variation variables. Each variable is the percentage deviation from the steady state value. This applies to c1, k1, n1, i1, and a1 The bij's are coefficients that we seek.*) c1:=b11 k1 + b12 a1; n1:=b21 k1 + b22 a1; i1:=b31 k1 + b32 a1; k2:=b41 k1 + b42 a1; (* And for next period (period t+1) *) c2:=b11 k2 + b12 a2; n2:=b21 k2 + b22 a2; a2:=rho a1; (* Pack the four mi's into one: *) m0=Join[m1,m2,m3,m4]; (* There are 8 eq'ns and 8 unknowns. Each of the mi's is 2 eq'ns. Each is of the form (AAA) k1 +(BBB) a1 ==(CCC)k1 + (DDD)a1 This is solved by the "Method of undetermined coefficients", which is done next. The method of undetermined coefficients is a fancy term for the idea that (AAA) gets set equal to (CCC), and (BBB) to (DDD). *) z1=Simplify[m0/.{a1->1,k1->0}]; z2=Simplify[m0/.{a1->0,k1->1}]; (* You have just created 8 eq'ns in the 8 unknown bij's.*) (* These are: *) z1 {-6.215877084096047*b12 == -5.905083229891245*b12 + 0.3448568606256486*b22 - 0.3630072217112091*b42-6.215877084096047*b11*b42+ .3630072217112091*b21*b42, 1.430239128910113*b12 + 0.821619014309687*b22 == 0.953492752606742 - 0.2383731881516856*b22, b42 == 0.07625072402352464*b32, 0.4638585711431082 + 0.3478939283573311*b22 == 0.3876078471195834*b12 + 0.07625072402352464*b32} z2 {-6.215877084096047*b11== -0.3630072217112091*b41 - 6.215877084096047*b11*b41 + 0.3630072217112091*b21*b41, 1.430239128910113*b11 + 0.821619014309687*b21 == 0.2383731881516856 - 0.2383731881516856*b21, b41 == 0.92 + 0.07625072402352464*b31, 0.115964642785777 + 0.3478939283573311*b21 == 0.3876078471195834*b11 + 0.07625072402352464*b31} (*Put them together: *) z0=Join[z1,z2]; (* Check that we have 8 equations: *) Length[z0] 8 (* Now solve the system. *) Timing[sol2=FindRoot[z0, {b11,.2},{b12,.2}, {b21,-.1},{b22,.2}, {b31,.2},{b32,.2}, {b41,.2},{b42,.2}]] {0.2190000000004222*Second, {b11 -> 0.3379448177104902, b12 -> 0.822526383256435, b21 -> -0.2311042599949503, b22 -> -0.2103002878416458, b31 -> -1.251466009588619, b32 -> 0.942662488502283, b41 -> 0.824574810678037, b42 -> 0.07187869725811657}} 3. Interpret the coefficients. The case gam = ngam = 1.5 is shown here. Your task now is to interpret this case and the case in which gam = ngam = 1.5. To aid you in your interpretation, note that the consumption function is of the form c_hat(t) = 0.34 k_hat(t) + 0.82 a_hat(t) where the x_hat(t) means the date t percentage deviation of x away from the steady state x. Notice a few things: A) Higher capital (k1) causes 1) Higher consumption (b11>0) 2) Lower labor input (b21<0) 3) Lower investment (b31<0) 4) Higher K(t+1) (b41>0) B) Higher current technology (a1) causes 1) Higher consumption (b12>0) 2) Lower labor input (b22<0) 3) Higher investment (b31>0) 4) Hihger K(t+1) (b41>0) These impacts may or may not remain valid when the individual's preferences change (that is, they may be different when you plug in the new values for gam and ngam). The intepretation of the numbers should consist of the following items: a story (pictures, equations might help) that explains each of the 8 inequalities just listed. In other words, you should say what b11 > 0 means and why it should hold. Does it still hold when the gam's change? Also, try to move beyond qualitative statements (such as "When X goes up Y goes down") and into quantitative statements ( such as "When X goes up by 1%, Y goes down by 2% but Z goes down by 8% because..."). People who listen to economists prefer quantitative to statements.