/* fs2000 as a stoch model model Taylor rule determines ffr rate and ior rate is set equal */ var m ${m}$ (long_name='Money Stock') P ${P}$ (long_name='Price Level') c ${c}$ (long_name='Consumption') ER ${ER}$ W ${W}$ (long_name='Nominal Wage') Rf ${R}$ (long_name='Nominal Rental Rate of Capital') k ${k}$ (long_name='Capital') d ${d}$ (long_name='Deposits') n ${n}$ (long_name='Hours worked') l ${l}$ (long_name='Loans') gy_obs ${\Delta y^{obs}}$ (long_name='Observed growth rate of output') gp_obs ${\Delta m^{obs}}$ (long_name='Observed growth rate of prices') y ${y}$ (long_name='Output') dA ${\Delta A}$ (long_name='Labor Augm. Techn. Growth Rate') Pi ${\pi}$ (long_name='Inflation Rate') gap $\Delta$ (long_name='GDP gap') % ffr ${ffr}$ (long_name='Federal Funds Rate'); Rh ${Rh}$ (long_name='Interest rate on deposits') er ${ior rate}$ (long_name='ffr and ior Rate'); varexo e_a ${\varepsilon_a}$ (long_name='Technology shock') e_m ${\varepsilon_m}$ (long_name='Observed money growth rate'); parameters alp ${\alpha}$ (long_name='capital share') bet ${\beta}$ (long_name='discount factor') gam ${\gamma}$ (long_name='Average technology growth') mst ${\bar m}$ (long_name='Average money stock') rho ${\rho}$ (long_name='Autocorrelation money process') psi ${\psi}$ (long_name='Leisure weight in utility') del ${\delta}$ (long_name='depreciation') e g h Yf etta Rho phi_pi phi_y pi_star; alp = 0.33; bet = 0.99; gam = 0.003; mst = 1.011; rho = 0.7; psi = 0.787; del = 0.02; e = 1; g = .0001; h = .3; Yf = 0.608187; % potential output etta = .99; % eta is fixed at .01 Rho = 0.8; phi_pi=.5; // 1.5; phi_y=.5; // 1.5; pi_star=0.005; % options_.TeX=1; model; dA = exp(gam+e_a); log(m) = (1-rho)*log(mst) + rho*log(m(-1)) + e_m; -P/(c(+1)*P(+1)*m)+bet*P(+1)*(alp*k^(alp-1)*n(+1)^(1-alp)+(1-del))/(c(+2)*P(+2)*m(+1))=0; W = (l/n); -(psi/(1-psi))*(c*P/(1-n))+ (l/n) = 0; Rf = P*(1-alp)*k(-1)^alp*n^(-alp)/(W*etta); % denominator is (W(1-eta)) 1/(c*P)-bet*P*(1-alp)*k(-1)^alp*n^(1-alp)/(m*l*c(+1)*P(+1)) = 0; c+k = k(-1)^alp*n^(1-alp)+(1-del)*k(-1); P*c + ER = m; % money equilibrium d = l + ER; % bank's balance sheet ER = g + h*er; % demand for ERs by banks Rf*etta = Rh; % wedge between loan rate and ior rate is etta y = k(-1)^alp*n^(1-alp); gy_obs = dA*y/y(-1); gp_obs =(P/P(-1))*m(-1); % /dA; % doesn't like this Pi = P/P(-1); % inflation rate gap = ((Yf-y)/y); // Taylor Rule // interest =Rho*interest(-1)+(1-Rho)*steady_state(interest)+phi_pi*(Pi-pi_star); % +(1-Rho)*phi_y*(y/y(-1)-1); er =Rho*Rh(-1)+(1-Rho)*(er-1)+phi_pi*(Pi-pi_star)+(1-Rho)*phi_y*(y/y(-1)-1); // er = Pi +.5*gap; % .5*(Pi-1.02) + .5*gap + 1.02 -1; // Walsh end; initval; er = 1.0098; k = 6; m = mst; P = 2.25; c = 0.45; ER = .01; W = 4.5; Rf = 1.02; d = 0.85; n = .19; l = 0.86; y = 0.6; Pi = 1; gap = 0; end; steady; check; shocks; var e_a; stderr 0.014; var e_m; stderr 0.005; end; % simul(periods=2000); %stoch_simul(order=1,irf=20,graph_format=eps,periods=1000); // use w 2016 % stoch_simul(order=1,irf=20,graph_format=eps,periods=1000,contemporaneous_correlation,conditional_variance_decomposition=[1,3]); %2016 %write_latex_original_model; %write_latex_static_model; %write_latex_parameter_table; %write_latex_dynamic_model; %write_latex_definitions; %collect_LaTeX_Files(M_); estimated_params; alp, beta_pdf, 0.356, 0.02; bet, beta_pdf, 0.993, 0.002; gam, normal_pdf, 0.0085, 0.003; mst, normal_pdf, 1.0002, 0.007; rho, beta_pdf, 0.129, 0.223; psi, beta_pdf, 0.65, 0.05; del, beta_pdf, 0.01, 0.005; stderr e_a, inv_gamma_pdf, 0.035449, inf; stderr e_m, inv_gamma_pdf, 0.008862, inf; end; varobs gp_obs gy_obs; % estimation(order=1,datafile=fsdat_simul, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8); estimation(order=1,datafile=fsdat_simul, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8,diffuse_filter,conf_sig=.95, bayesian_irf); /* // Figures tt=0:2001; figure('Name','ior, R and Rf'); subplot(1,1,1); plot([0:49], oo_.exo_simul(1:50,1),'k','LineWidth',1.5); hold on; plot([51:1999], oo_.exo_simul(52:2000,1),'--k','LineWidth',1.5); hold on; plot([0:49], oo_.endo_simul(6,1:50),':r'); // both interest rates together hold on; plot([51:1999], oo_.endo_simul(6,52:2000),'-.b');//both interest rates together title('IOR, deposit, and loan interet rates'); axis([0 100 1.005 1.035]); xlabel('time') ylabel('percent %,\xi') legend('ior & R before change', 'ior & R after change','Rf before change','Rf after change','Location','southeast') // figure 2 figure('Name','banks balance sheet'); subplot(3,1,1); plot(tt, oo_.endo_simul(4,:)); title('ER'); xlabel('1') ylabel('ER(ior)') axis([0 200 0.3 .31]); subplot(3,1,2); plot(tt, oo_.endo_simul(10,:)); title('loans to firms'); xlabel('2'); ylabel('l'); axis([0 200 0.57 .62]); subplot(3,1,3); plot(tt, oo_.endo_simul(8,:)); title('deposits'); ylabel('d'); xlabel('3'); axis([0 200 .89 .91]); // figure 3 figure('Name','labor equation'); subplot(3,1,1); plot(tt, oo_.endo_simul(10,:)); title('loans to firms'); xlabel('1'); ylabel('loans'); axis([0 200 0.582 .6]); subplot(3,1,2); plot(tt, oo_.endo_simul(12,:)); title('Labor'); % from new Labor xlabel('2'); ylabel('\zeta'); axis([0 200 .184 .186]); subplot(3,1,3); plot(tt, oo_.endo_simul(5,:)); title('wages'); xlabel('3'); ylabel('\omega'); axis([0 200 3.158 3.24]); // figure 4 figure('Name','Money equilibrium'); subplot(2,2,1); plot(tt, oo_.endo_simul(1,:),'--b'); title('Money Supply'); axis([0 2000 .5 2]); xlabel('1') ylabel('M(m*,m(-1),\rho)') subplot(2,2,2); plot(tt, oo_.endo_simul(4,:)); title('ER'); xlabel('2') ylabel('ER(ior)') axis([0 200 0.3 .31]); subplot(2,2,3); plot(tt, oo_.endo_simul(2,:),'c'); title('Price Level'); axis([0 400 1.483 1.5]); xlabel('3') ylabel('P(k,m,c,\delta)') subplot(2,2,4); plot(tt, oo_.endo_simul(3,:),'g'); title('Consumption'); xlabel('4') ylabel('C') axis([0 200 0.47 .47555]); //figure 5 figure('Name','GDP'); subplot(3,1,1); plot(tt, oo_.endo_simul(11,:)); title('output'); xlabel('1'); ylabel('Y'); axis([0 200 .58 .63]); subplot(3,1,2); plot(tt, oo_.endo_simul(3,:),'g'); title('Consumption'); xlabel('2') ylabel('C') axis([0 200 0.47 .48]); subplot(3,1,3); plot(tt, oo_.endo_simul(7,:)); title('capital'); xlabel('3'); ylabel('K'); axis([0 200 6.6 6.8]); // fig 6 figure('Name','inflation'); subplot(3,1,1); plot(tt, oo_.endo_simul(13,:)); title('inflation'); xlabel('1'); ylabel('\pi'); axis([0 200 .99 1.01]); subplot(3,1,2); plot(tt, oo_.endo_simul(14,:)); title('GDP gap'); xlabel('3'); ylabel('percent \Delta'); axis([0 200 -0.5 .1]); subplot(3,1,3); plot(tt, oo_.endo_simul(15,:)); title('FFR - taylor rule'); xlabel('2'); ylabel('FFR'); axis([0 200 -0.9 1.3]); */ /* //fig. 5 figure('Name','Labor equations'); subplot(2,2,1); plot(tt, oo_.endo_simul(9,:)); title('original labor'); xlabel('1'); ylabel('l'); axis([0 200 .1 .25]); subplot(2,2,2); plot(tt, oo_.endo_simul(12,:)); title('new Labor Equation'); xlabel('2'); ylabel('L'); axis([0 200 0.16 .22]); subplot(2,2,3); plot(tt, oo_.endo_simul(5,:)); title('wages'); xlabel('3'); ylabel('\omega'); axis([0 200 2 4]); subplot(2,2,4); plot(tt, oo_.endo_simul(10,:)); title('Loans to firms'); xlabel('4'); ylabel('\lambda'); axis([0 200 0.25 .8]); */