% % ex4 is a matlab file that solves for % the 'steady-state' for a simplified Kydland and Prescott model % using the ex4F.m file % % ----- save output to file ----- % clear all diary ex4.mout diary off delete ex4.mout diary ex4.mout % ----- display date and time of computation ----- % %format long date time0 = clock; % ----- define the parameters ----- % alpha = 1/3; thetabar = 1; delta = 0.10; beta = 0.99; % ----- dfine fsolve options ----- % options = optimset('Display','iter','MaxIter',1000); % ----- solve for steady states ----- % x = fsolve(@ex4F,[1 1],options,alpha,delta,beta,thetabar) % ----- linearized eulers coeffs ----- % h0 = 1/x(1) - 1/x(1)*beta*( alpha*x(2)^(alpha-1) + 1-delta ) h1 = -(alpha*x(2)^alpha + (1-delta)*x(2))/(x(1)^2) h2 = x(2)/(x(1)^2) + (alpha*x(2)^alpha+(1-delta)*x(2))/(x(1)^2)*beta*(alpha*x(2)^(alpha-1)+1-delta) - ... 1/x(1)*beta*(alpha*(alpha-1)*x(2)^(alpha-1) ) h3 = x(2)/(x(1)^2)*beta*(alpha*x(2)^(alpha-1)+ 1-delta ) % ----- exit ----- % comptime = etime(clock, time0) diary off