% % ch2ex3.m is a matlab file that solves the % ramsey model using uhlig method % % ----- save output to file ----- % clear all diary ch2ex3.mout diary off delete ch2ex3.mout diary ch2ex3.mout % ----- display date and time of computation ----- % %format long date time0 = clock; % ----- define the parameters ----- % alpha = 0.36; delta = 0.025 ; beta = 0.99; abar = 1; phi = 0.95; % ----- steady states from ch2ex1 ----- % sol1 = [37.9893 2.7543]; kbar = [37.9893]; cbar = [2.7543]; % ----- define the parameters of the model ----- % AA = [-kbar/(cbar+kbar-(1-delta)*kbar)] ; BB = [alpha+(1-delta)*kbar/(cbar+kbar-(1-delta)*kbar)] ; CC = [-cbar/(cbar+kbar-(1-delta)*kbar)]; DD = [1]; FF = [0]; GG = [beta*alpha*(alpha-1)*abar*kbar^(alpha-1)/cbar]; HH = [0] ; JJ = [-beta*(alpha*abar*kbar^(alpha-1)+1-delta)/cbar]; KK = [1/cbar]; LL = [beta*alpha*abar*kbar^(alpha-1)/cbar ]; MM = [0]; NN = [phi]; % ----- solve using uhligs code solvem.m ----- % [PP,QQ,RR,SS] = solvem(AA,BB,CC,DD,FF,GG,HH,JJ,KK,LL,MM,NN); % ----- exit ----- % comptime = etime(clock, time0) diary off