A Simple Real Business Cycle Model: An Application of Mathematica

Dibyendu Maiti
Delhi School of Economics
dibyendu@econdse.org

Wolfaram Mathematica Workshop, 1-2 May 2017, New Delhi

The presentation shows an application of Mathemetica for running a simple RBC model, demonstrated in Amadou (2012) and other Mathematica internal resources. The basic purpose of this presentation is to demonstratie the application of Mathematica   used in the decipline of economics.

1. Introduction:

Fundamental questions:
1) Why do cycle exists?
2) If so, how long does it take to come back to the trend?
3) Can we generate a path of cycle from one time technological shock?

Fundamentals of RBC:

* The business cycle is mainly driven by fluctuations in the rate of productivity growth, in the absence of any policy intervension. 
* The employment fluctuations observed during business cycles reflect voluntary movements along individual labour supply curves (intertemporal substitution in labour supply, no involuntary unemployment). 
* Economic growth and business cycles can and should be explained within a unified model framework.

* Basic Model
Max (Subscript[E, 0])[[(∑_(t=0)^∞)((((Subscript[c, t]^(1-θ))-1)/(1-θ))-ψ(( (Subscript[l, t]^(1+γ)) )/(1+γ)))]]
sub to:
(Subscript[c, t])+(Subscript[iv, t])=(Subscript[y, t])
(Subscript[y, t])=(Subscript[z, t])(Subscript[k, t]^α)(Subscript[l, t]^(1-α))
(Subscript[k, t+1])=(1-δ)(Subscript[k, t])+(Subscript[iv, t])
log[(Subscript[z, t+1])]=(1-ρ)log[zs]+ρ Log[(Subscript[z, t])]+(Subscript[ϵ, t])

Variables:
(Subscript[c, t])=consumtion at t-th period
(Subscript[iv, t])= investment at t-th period
(Subscript[y, t])= outout at t-th period
(Subscript[k, t])= capital stocks at t-th period
(Subscript[l, t])=labour suply at t-th period
(Subscript[z, t])= technology at t-th period
(Subscript[ϵ, t+1])=random innovation of technology

Parameters:
β∈(0,1) = discount factor
(1/θ)= constant intertemporat substitution in concumption between periods, θ>0
γ=invese of the Frisch intertemporal elasticity substitution in labour supply, γ>0
ψ=degree of disutility of labour supply
δ∈(0,1)= depreciation rate of capital stocks
ρ∈(0,1)= autocorrelation parameter of technology

Steps:
1) The equation of motion
2) Bellman equations
3) Optimization
4) Steady state equilibrium
5) Loglinearisation 
6) Deviation from steady-state
7) Technological shock - deterministics and stochastics (not in this presentation)

1. The equation of motion

rbc3 = (Subscript[k, t+1])==(1-δ) (Subscript[k, t]) + (Subscript[iv, t])

rbc4 = (Subscript[c, t])+ (Subscript[iv, t]) == (Subscript[y, t])

rbc5 = Solve [rbc4, (Subscript[iv, t])][[1,1]]

rbc6 =rbc3/.rbc5

rbc7 = rbc6 /.(Subscript[y, t])-> (Subscript[z, t])(Subscript[k, t]^α)(Subscript[l, t]^(1-α))

2.1 The Bellman equation

v[(Subscript[k, t]),(Subscript[z, t])]=(Underscript[Max, ((Subscript[c, t]),(Subscript[k, t+1]),(Subscript[l, t]))]){((Subscript[c, t]^(1-θ))/(1-θ))-ψ ((Subscript[l, t]^(1+γ))/(1+γ))+β (Subscript[EX, t])[v[(Subscript[k, t+1]),(Subscript[z, t+1])]]}
subject to:
Resource contraint : (Subscript[k, 1+t])==-(Subscript[c, t])+(1-δ) (Subscript[k, t])+(Subscript[y, t])
And technology : Log [(Subscript[z, t+1])]=(1-ρ) Log [zs]+ρ Log [(Subscript[z, t])]+(Subscript[ϵ, t+1])

rbc8 = v[(Subscript[k, t]),(Subscript[z, t])]

rbc9 = ((Subscript[c, t]^(1-θ))/(1-θ))-ψ ((Subscript[l, t]^(1+γ))/(1+γ))+β (Subscript[EX, t])[v[(Subscript[k, t+1]),(Subscript[z, t+1])]]

rbc10 =Log [(Subscript[z, t+1])]==(1-ρ) Log [zs]+ρ Log [(Subscript[z, t])]+(Subscript[ϵ, t+1])

rbc11= ((Subscript[c, t]^(1-θ))/(1-θ))-ψ ((Subscript[l, t]^(1+γ))/(1+γ))+β v[(Subscript[k, t+1]),(Subscript[z, t+1])]

rbc12  = rbc7[[1]]- (Subscript[k, t+1]) == rbc7[[2]]- (Subscript[k, t+1])

rbc13 = rbc12[[1]] +(Subscript[c, t]) == rbc12[[2]]+(Subscript[c, t])

rbc14=rbc11/.rbc13[[1]]->rbc13[[2]]

rbc15 =D[rbc14, (Subscript[k, t+1])]==0

rbc16=D[rbc14, (Subscript[l, t])]==0

rbc17=D[rbc8,(Subscript[k, t])]==D[rbc14,(Subscript[k, t])]

rbc18 =rbc17/.t->t+1

rbc19=rbc15/.Derivative[1,0][v][(Subscript[k, 1+t]),(Subscript[z, 1+t])]->(Subscript[EX, t])[Derivative[1,0][v][(Subscript[k, 1+t]),(Subscript[z, 1+t])]]

rbc20=rbc19/.rbc18[[1]]->rbc18[[2]]

rbc21=rbc13

rbc22=rbc21/.t->t+1

rbc23=rbc20/.{rbc21[[2]]->rbc21[[1]],rbc22[[2]]->rbc22[[1]]}

rbc24=rbc23/.(Subscript[EX, t])[(Subscript[c, 1+t]^(-θ)) (1-δ+α (Subscript[k, 1+t]^(-1+α)) (Subscript[l, 1+t]^(1-α)) (Subscript[z, 1+t]))]->(Subscript[c, 1+t]^(-θ)) (1-δ+α (Subscript[k, 1+t]^(-1+α)) (Subscript[l, 1+t]^(1-α)) (Subscript[z, 1+t]))

rbc25=rbc16/.rbc21[[2]]->rbc21[[1]]

rbc26=Solve[rbc25, (Subscript[c, t])]

rbc27=rbc26[[1,1,1]]==rbc26[[1,1,2]]

rbc28=PowerExpand[rbc27]

2.2 The Steady-State Equalibrium

rbc29=rbc23

rbc30=rbc29/.{(Subscript[c, t])->cs, (Subscript[c, t+1])->cs,(Subscript[k, t+1])->ks,(Subscript[l, t+1])->ls,(Subscript[z, t+1])->zs}

rbc31=rbc30/.(Subscript[EX, t])[(cs^(-θ)) (1+(ks^(-1+α)) (ls^(1-α)) zs α-δ)]->(cs^(-θ)) (1+(ks^(-1+α)) (ls^(1-α)) zs α-δ)

rbc32=rbc31/.zs->1

rbc33=Expand[((rbc32[[1]])/(cs^(-θ)))==((rbc32[[2]])/(cs^(-θ)))]

rbc34=Solve[(ks/ls)==kls,ks][[1,1]]

rbc35=rbc33/.rbc34//PowerExpand

rbc36=Solve[rbc35, kls][[1,1]]

rbc37=rbc36[[1]]==rbc36[[2]]

rbc38=rbc28

rbc39=rbc38/.{(Subscript[c, t])->cs, (Subscript[k, t])->ks,(Subscript[l, t])->ls,(Subscript[z, t])->zs}

rbc40=rbc39/.zs->1

rbc41=rbc40/.rbc34//PowerExpand

rbc42=rbc41/.rbc36

rbc43=rbc7

rbc44=rbc43/.{(Subscript[c, t])->cs, (Subscript[k, t])->ks, (Subscript[k, t+1])->ks,(Subscript[l, t])->ls,(Subscript[z, t])->1}

rbc45=Map[(1/ks)#&, rbc44]//Expand

rbc46=rbc45/.rbc34//PowerExpand

rbc47=rbc46/.{rbc36,rbc42[[1]]->rbc42[[2]]}

rbc48=Solve[rbc47,ls]//FullSimplify

rbc49=rbc48[[1,1,1]]==rbc48[[1,1,2]]

rbc50=rbc42/.rbc49[[1]]->rbc49[[2]]

rbc51 =FullSimplify[rbc50]

rbc52=rbc34

rbc53=rbc52[[1]]==rbc52[[2]]

rbc54=rbc53/.{rbc36,rbc49[[1]]->rbc49[[2]]}

rbc55=FullSimplify[rbc54]

rbc56=(Subscript[y, t])==(Subscript[z, t])(Subscript[k, t]^α)(Subscript[l, t]^(1-α))

rbc57=rbc56/.{(Subscript[y, t])->ys, (Subscript[z, t])->zs, (Subscript[k, t])->ks,(Subscript[l, t])->ls}

rbc58=rbc57/.{rbc55[[1]]->rbc55[[2]],rbc49[[1]]->rbc49[[2]],zs->1}

rbc59=FullSimplify[rbc58]

rbc60=rbc5

rbc61=rbc60[[1]]==rbc60[[2]]

rbc62=rbc61/.{(Subscript[iv, t])->ivs, (Subscript[c, t])->cs, (Subscript[y, t])->ys}

rbc63=rbc62/.{rbc51[[1]]->rbc51[[2]],rbc59[[1]]->rbc59[[2]]}

3. Log-linearization

rbc64=(Subscript[xh, t])==Series[Log[((Subscript[x, t])/xs)],{(Subscript[x, t]),xs,1}]//Normal

rbc65=Simplify[xs (e^(Subscript[xh, t]))/.(Subscript[xh, t])->Log[e,((Subscript[x, t])/xs)]]

3.1 The Labour-Leisure Choice Equation

Multivariate Taylor series appoximation:
1) Mathematical function to be approximated
2) Variables with respect to be linearised
3) Points around to be linearised

mulLinearTaylor[f_,x_,a_]:=Module [{fa,gradf, gradfa}, fa=f//.Thread[x->a]; gradf=D[f,{x}];gradfa=gradf//.Thread[x->a]; fa+gradfa.(x-a)]

rbc66=rbc28

rbc67=rbc66/.{(Subscript[c, t])->cs (e^(Subscript[ch, t])), (Subscript[l, t])->ls (e^(Subscript[lh, t])),(Subscript[k, t])->ks (e^(Subscript[kh, t])),(Subscript[z, t])->zs (e^(Subscript[zh, t]))}

rbc68=Series[rbc67[[1]],{(Subscript[ch, t]),0,1}]/.Log [e]->1//Normal

rbc69=mulLinearTaylor[rbc67[[2]],{(Subscript[lh, t]),(Subscript[zh, t]),(Subscript[kh, t])},{0,0,0}]/.Log [e]->1

rbc70=rbc68==rbc69/.Log [e]->1

rbc71=rbc66/.{ (Subscript[c, t])->cs, (Subscript[l, t])->ls,(Subscript[k, t])->ks,(Subscript[z, t])->zs}

rbc72=rbc70[[1]]-rbc71[[1]]==rbc70[[2]]-rbc71[[2]]

rbc73=((rbc72[[1]])/(rbc71[[1]]))==Apply[Plus, Table[FullSimplify[((rbc72[[2,i]])/(rbc71[[2]]))],{i,1,Length[rbc72[[2]]]}]]

rbc74=rbc24

rbc75=rbc74[[1]]-β (Subscript[c, t+1]^(-θ))(1-δ+α (Subscript[k, t+1]^(-1+α))(Subscript[l, t+1]^(1-α))(Subscript[z, t+1]))==rbc74[[2]]-β (Subscript[c, t+1]^(-θ))(1-δ+α (Subscript[k, t+1]^(-1+α))(Subscript[l, t+1]^(1-α))(Subscript[z, t+1]))

rbc76=Map[-1#&, rbc75]

rbc77=rbc76/.{(Subscript[c, t])->cs (e^(Subscript[ch, t])),(Subscript[c, t+1])->cs (e^(Subscript[ch, t+1])),(Subscript[k, t+1])->ks (e^(Subscript[kh, t+1])),(Subscript[l, t+1])->ls (e^(Subscript[lh, t+1])),(Subscript[z, t+1])->zs (e^(Subscript[zh, t+1]))}

rbc78=Series[rbc77[[1]],{(Subscript[ch, t]),0,1}]/.Log [e]->1//Normal

rbc79=mulLinearTaylor[rbc77[[2]],{(Subscript[ch, t+1]),(Subscript[lh, t+1]),(Subscript[zh, t+1]),(Subscript[kh, t+1])},{0,0,0,0}]/.Log [e]->1

rbc80=rbc78==rbc79

rbc81=rbc76/.{(Subscript[c, t])->cs,(Subscript[c, t+1])->cs,(Subscript[k, t+1])->ks,(Subscript[l, t+1])->ls,(Subscript[z, t+1])->zs}

rbc82=rbc80[[1]]-rbc81[[1]]==rbc80[[2]]-rbc81[[2]]

rbc83=((rbc82[[1]])/(-(cs^(-θ))))==Apply[Plus, Table[FullSimplify[((rbc82[[2,i]])/(-(cs^(-θ))))],{i,1,Length[rbc82[[2]]]}]]

rbc84=Map[(1/(cs^(-θ)))#&,rbc81]

rbc85=rbc84[[2]]==rbc84[[1]]

rbc86=rbc83/.rbc85[[1]]->rbc85[[2]]

rbc87=rbc86/.zs->1

rbc88=rbc87/.{(Subscript[ch, t+1])->(Subscript[EX, t])[(Subscript[ch, t+1])],(Subscript[kh, t+1])->(Subscript[EX, t])[(Subscript[kh, t+1])],(Subscript[lh, t+1])->(Subscript[EX, t])[(Subscript[lh, t+1])], (Subscript[zh, t+1])->(Subscript[EX, t])[(Subscript[zh, t+1])]}

3.3 The resource Constraint

rbc89=rbc7

rbc90=rbc89/.{(Subscript[c, t])->cs (e^(Subscript[ch, t])),(Subscript[k, t+1])->ks (e^(Subscript[kh, t+1])),(Subscript[k, t])->ks (e^(Subscript[kh, t])),(Subscript[l, t])->ls (e^(Subscript[lh, t])),(Subscript[z, t])->zs (e^(Subscript[zh, t]))}

rbc91=Series[rbc90[[1]],{(Subscript[kh, t+1]),0,1}]/.Log [e]->1//Normal

rbc92=mulLinearTaylor[rbc90[[2]],{(Subscript[ch, t]),(Subscript[lh, t]),(Subscript[zh, t]),(Subscript[kh, t])},{0,0,0,0}]/.Log [e]->1

rbc93=rbc91==rbc92

rbc94=rbc89/.{(Subscript[c, t])->cs,(Subscript[k, t])->ks,(Subscript[k, t+1])->ks,(Subscript[l, t])->ls,(Subscript[z, t])->zs}

rbc95=rbc93[[1]]-rbc94[[1]]==rbc93[[2]]-rbc94[[2]]

rbc96=((rbc95[[1]])/ks)==Apply[Plus,Table[FullSimplify[((rbc95[[2,i]])/ks)],{i,1,Length[rbc95[[2]]]}]]

rbc97=rbc96/.zs->1

3.4 Technology Equation

rbc98=rbc10

rbc99=rbc98/.{(Subscript[z, t+1])->zs (e^(Subscript[zh, t+1])),(Subscript[z, t])->zs (e^(Subscript[zh, t]))}

rbc100=Series[rbc99[[1]],{(Subscript[zh, t+1]),0,1}]/.Log [e]->1//Normal

rbc101=Series[rbc99[[2]],{(Subscript[zh, t]),0,1}]/.Log [e]->1//Normal

rbc102=rbc100==rbc101

rbc103=rbc98/.{(Subscript[z, t+1])->zs,(Subscript[ϵ, t+1])->0,(Subscript[z, t])->zs}

rbc104=rbc102[[1]]-rbc103[[1]]==rbc102[[2]]-rbc103[[2]]//Simplify

rbc105=rbc104[[2]]==rbc104[[1]]

rbc106=(Subscript[EX, t])[(Subscript[zh, t+1])]==ρ (Subscript[zh, t])

rbc107=(Subscript[zh, t+1])==ρ (Subscript[zh, t])

3.5 The Output Equation

rbc108=rbc56

rbc109=rbc108/.{(Subscript[y, t])->ys (e^(Subscript[yh, t])),(Subscript[k, t])->ks (e^(Subscript[kh, t])),(Subscript[l, t])->ls (e^(Subscript[lh, t])),(Subscript[z, t])->zs (e^(Subscript[zh, t]))}

rbc110=Series[rbc109[[1]],{(Subscript[yh, t]),0,1}]/.Log[e]->1//Normal

rbc111=mulLinearTaylor[rbc109[[2]],{(Subscript[lh, t]),(Subscript[zh, t]),(Subscript[kh, t])},{0,0,0}]

(ks^α) (ls^(1-α)) zs+(ks^α) (ls^(1-α)) zs α Log[e] (Subscript[kh, t])+(ks^α) (ls^(1-α)) zs (1-α) Log[e] (Subscript[lh, t])+(ks^α) (ls^(1-α)) zs Log[e] (Subscript[zh, t])/.Log[e]->1

rbc112=rbc110==rbc111/.Log[e]->1

rbc113=rbc108/.{(Subscript[y, t])->ys ,(Subscript[k, t])->ks ,(Subscript[l, t])->ls ,(Subscript[z, t])->zs }

rbc114=rbc112[[1]]-rbc113[[1]]==rbc112[[2]]-rbc113[[2]]

rbc115=((rbc114[[1]])/(rbc113[[1]]))==((rbc114[[2]])/(rbc113[[2]]))//Expand

rbc116=Collect[rbc115,(Subscript[lh, t])]

3.6 The Identity Consumption plus Investment is equal to output

rbc117=rbc61

rbc118=rbc117/.{(Subscript[y, t])->ys (e^(Subscript[yh, t])),(Subscript[c, t])->cs (e^(Subscript[ch, t])),(Subscript[iv, t])->ivs (e^(Subscript[ivh, t]))}

rbc119=Series[rbc118[[1]],{(Subscript[ivh, t]),0,1}]/.Log [e]->1//Normal

rbc120=mulLinearTaylor[rbc118[[2]],{(Subscript[ch, t]),(Subscript[yh, t])},{0,0}]/.Log [e]->1

rbc121=rbc119==rbc120

rbc122=rbc117/.{(Subscript[y, t])->ys ,(Subscript[c, t])->cs ,(Subscript[iv, t])->ivs }

rbc123=rbc121[[1]]-rbc122[[1]]==rbc121[[2]]-rbc122[[2]]

rbc124=Map[(1/ivs)#&,rbc123]//Expand

4. Solving the Model
4.1 Matrix Form Representation

rbc125=(Subscript[u, t])=={(Subscript[ch, t]), (Subscript[kh, t]),(Subscript[lh, t]),(Subscript[zh, t])}

rbc126=rbc125/.t->t+1

rbc127=rbc73

rbc128=rbc87

rbc129=rbc97

rbc130=rbc107

rbc131=rbc127[[1]]-rbc127[[2]]==0

rbc132=rbc128

rbc133=rbc129[[2]]==rbc129[[1]]

rbc134=rbc130[[2]]==rbc130[[1]]

rbc135=CoefficientArrays[{rbc131,rbc132,rbc133,rbc134}, rbc125[[2]]]//Normal

rbc136=A==rbc135[[2]]

rbc137=rbc136

rbc138=MatrixForm[rbc137]//TraditionalForm

rbc139=CoefficientArrays[{rbc131,rbc132,rbc133,rbc134}, rbc126[[2]]]//Normal

rbc140=rbc139[[2]]

rbc141=B==Map[-1#&, rbc140, {2}]

rbc142=rbc141

rbc143=MatrixForm[rbc142]//TraditionalForm

4.2 Defining Paramteres (calibration)

rbc144=rbc49

rbc145=rbc144/.{α->0.36,β->0.99,δ->0.025, θ-> 3, ψ->3,γ->0.33}

rbc146=rbc51

rbc147=rbc146/.{α->0.36,β->0.99,δ->0.025, θ-> 3, ψ->3,γ->0.33}

rbc148=rbc55

rbc149=rbc148/.{α->0.36,β->0.99,δ->0.025, θ-> 3, ψ->3,γ->0.33}

rbc150=rbc59

rbc151=rbc150/.{α->0.36,β->0.99,δ->0.025, θ-> 3, ψ->3,γ->0.33}

rbc152=rbc63

rbc153=rbc152/.{α->0.36,β->0.99,δ->0.025, θ-> 3, ψ->3,γ->0.33}

rbc154=rbc136

rbc155=rbc154/.{α->0.36,δ->0.025, θ-> 3, ψ->3,γ->0.33,ρ->0.95,cs->rbc147[[2]], ks->rbc149[[2]], ls->rbc145[[2]]}//N

rbc156=rbc155

rbc157=MatrixForm[rbc156]//TraditionalForm

rbc158=rbc141

rbc159=rbc158/.{α->0.36,β->0.99, θ-> 3, ks->rbc149[[2]], ls->rbc145[[2]], ls->rbc145[[2]]}//N

rbc160=rbc159

rbc161=MatrixForm[rbc160]//TraditionalForm

rbc162=Inverse[rbc155[[2]]].rbc159[[2]]

rbc163=Eigensystem[rbc162]

rbc164=rbc163[[1]]

rbc165=A==DiagonalMatrix[rbc164]

rbc166=rbc165

rbc167=MatrixForm[rbc166]//TraditionalForm

rbc168=rbc163[[2]]

rbc169=Inverse[rbc168]//Transpose

rbc170=rbc169

rbc171=MatrixForm[rbc170]//TraditionalForm

rbc172=rbc169[[3]]

rbc173=rbc172.rbc125[[2]]==0

rbc174=Solve[rbc173,(Subscript[ch, t])]//Expand

rbc175=rbc174[[1,1,1]]==rbc174[[1,1,2]]

rbc176=rbc97

rbc177=rbc176/.{α->0.36,δ->0.025,cs->rbc147[[2]], ks->rbc149[[2]], ls->rbc145[[2]]}

rbc178=rbc73

rbc179=Solve[rbc178,(Subscript[lh, t])]//Expand

rbc180=rbc179[[1,1,1]]==rbc179[[1,1,2]]

rbc181=rbc180/.{α->0.36,θ-> 3,γ->0.33}

rbc182=rbc116

rbc183=rbc182/.α->0.36

rbc184=rbc124

rbc185=rbc184/.{cs->rbc147[[2]], ivs->rbc153[[2]], ys->rbc151[[2]]}

rbc186=rbc105

rbc187=rbc186/.t->t+1

rbc188=rbc187/.ρ->0.95

rbc189=Solve[{rbc175,rbc177,rbc181,rbc183,rbc185},{(Subscript[ch, t]),(Subscript[lh, t]),(Subscript[yh, t]),(Subscript[kh, t+1]),(Subscript[ivh, t])}]

rbc190=Chop[rbc189]//Flatten

rbc191=rbc190[[1,1]]==rbc190[[1,2]]

rbc192=rbc190[[2,1]]==rbc190[[2,2]]

rbc193=rbc190[[3,1]]==rbc190[[3,2]]

rbc194=rbc190[[4,1]]==rbc190[[4,2]]

rbc195=rbc190[[5,1]]==rbc190[[5,2]]

rbc196=rbc188

fzh[ρ_,ϵ_,T_]:=Module[{res1,zh,t,T1}, T1=T+1;zh=Table[0,{i,T1}];res1=Table[0,{i,T1}];For[t=2,t≤T1,t++,zh[[t]]=ρ zh[[t-1]]+ϵ[[t]];res1[[t]]=zh[[t]];];res1]

rbc197=rbc194

fkh[a_,b_,T_,zh_]:=Module[{res1,res2,t,T1, kh}, T1=T+1;kh=Table[0,{i,T1}];res1=Table[0,{i,T1}];For[t=1,t≤(T1-1),t++,kh[[t+1]]=a kh[[t]]+b zh[[t]];res1[[t+1]]=kh[[t]];];res2=res1;Most[res2]]

rbc198=rbc191

fch[ac_,bc_,kh_,zh_]:=ac kh + bc zh

rbc199=rbc192

flh[a1_,b1_,kh_,zh_]:=a1 kh + b1 zh

rbc200=rbc193

fyh[ay_,by_,kh_,zh_]:= ay kh + by zh

rbc201=rbc195

fivh[aiv_,biv_,kh_,zh_]:=aiv kh +biv zh

5. Studing the Economy
5.1 Impulse Response Functions

ϵp1=Table[0,{i,100}];

ϵp2=Insert[ϵp1,0.083666,2];

rbc202=ListLinePlot[ϵp2,FrameLabel->{"Years after shock", "(Subscript[ϵ, t])"},PlotLabel-> "Shock to the innovations of Technology", Frame-> True, GridLines-> Automatic, GridLines-> Autometic, GridLinesStyle->Dashed]

rbc196

rbc203=fzh[0.95,ϵp2,99];

rbc204=ListLinePlot[rbc203,FrameLabel->{"Years after shock", "% deviation from steady state"},PlotLabel-> "Impulse Response to Technology, (OverHat[(Subscript[z, t])])", Frame-> True, GridLines-> Automatic, GridLinesStyle->Dashed,PlotStyle->{Thickness[0.007],Hue[0.65]}]

rbc197

rbc205 = fkh[rbc197[[2,1,1]],rbc197[[2,2,1]],100,rbc203];

rbc206=ListLinePlot[rbc205, FrameLabel->{"Years after shocks", "% deviation from steady-state"}, PlotLabel -> "Impulse Response of Capital Stock, (Subscript[(OverHat[k]), t])", Frame->True, GridLines->Automatic, GridLinesStyle->Dashed, PlotStyle->{Thickness[0.007],Hue[0.1]}]

rbc198

rbc207=fch[rbc198[[2,1,1]],rbc198[[2,2,1]],rbc205,rbc203];

rbc208=ListLinePlot[rbc207, FrameLabel->{"Years after shocks", "%deviation from steady-state"}, PlotLabel -> "Impulse Response of Capital Stock, (Subscript[(OverHat[c]), t])", Frame->True, GridLines->Automatic, GridLinesStyle->Dashed, PlotStyle->{Thickness[0.007],Hue[0.1]}]

rbc192

rbc209=flh[rbc192[[2,1,1]],rbc192[[2,2,1]],rbc205,rbc203];

rbc210=ListLinePlot[rbc209, FrameLabel->{"Years after shocks", "%deviation from steady-state"}, PlotLabel -> "Impulse Response of Capital Stock, (Subscript[(OverHat[l]), t])", Frame->True, GridLines->Automatic, GridLinesStyle->Dashed, PlotStyle->{Thickness[0.007],Hue[0.1]}]

rbc200

rbc211=fyh[rbc200[[2,1,1]],rbc200[[2,2,1]],rbc205,rbc203];

rbc212=ListLinePlot[rbc211, FrameLabel->{"Years after shocks", "% deviation from steady-state"}, PlotLabel -> "Impulse Response of Capital Stock, (Subscript[(OverHat[y]), t])", Frame->True, GridLines->Automatic, GridLinesStyle->Dashed, PlotStyle->{Thickness[0.007],Hue[0.1]}]

rbc213=fivh[rbc201[[2,1,1]],rbc201[[2,2,1]],rbc205,rbc203];

rbc214=ListLinePlot[rbc213, FrameLabel->{"Years after shocks", "% deviation from steady-state"}, PlotLabel -> "Impulse Response of Capital Stock, (Subscript[(OverHat[i]), t])", Frame->True, GridLines->Automatic, GridLinesStyle->Dashed, PlotStyle->{Thickness[0.007],Hue[0.1]}]

rbc215=ListLinePlot[{rbc203,rbc205,rbc207,rbc209,rbc2011,rbc213}, FrameLabel->{"Years after shocks", "% deviation from steady-state"}, PlotLabel -> "Impulse Response of the variables", Frame->True, GridLines->Automatic, GridLinesStyle->Dashed,PlotLegends->{"Technology", "Capital Stocks","Consumption", "Labour", "Output","Investment"},   PlotStyle->{Thickness[0.007],Hue[0.1]}]

rbc216=GraphicsGrid[{{rbc204,rbc206},{rbc208,rbc210}, {rbc212,rbc214}},ImageSize-> 600]