%rbc2rr.m Sept. 19, 1996 %Calcultaes solution to basic rbc model with parameters as % in Farmer's book % Checks for stability under learning. t dating m=0.36;nu=0.64;discount=0.99;delta=0.025;phi=1;mu=m; rho=0.95; ytok=(phi/discount+delta-1)/m; ctok=ytok-delta+1-phi; bet11=1+m*nu*ytok*discount/((1-nu)*phi); bet12=(discount/phi)*m*ytok*(1-mu/(1-nu)); bet13=-(discount/phi)*m*ytok/(1-nu); d11=-(ctok+ytok*nu/(1-nu))/phi; d12=(1-delta+ytok*mu/(1-nu))/phi; d13=(ytok/(1-nu))/phi; f=eye(3); f(2,1)=d11; f(2,2)=d12; f(2,3)=d13; g=zeros(3); g(1,1)=bet11;g(1,2)=bet12;g(1,3)=bet13;g(2,2)=1; g(3,3)=1/rho; j=inv(f)*g; [q d]=eig(j) p=inv(q); %c=pieck*k+piecs*s pieck=-p(1,2)/p(1,1) piecs=-p(1,3)/p(1,1) a=eye(2); a(1,1)=d11*pieck+d12; a(1,2)=d11*piecs+d13; a(2,2)=rho; a; mdel=zeros(3); mdel(2,1)=d11;mdel(2,2)=d12;mdel(2,3)=d13; mdel(3,3)=rho; mbet=zeros(3);mbet(1,1)=bet11;mbet(1,2)=bet12;mbet(1,3)=bet13; bre=zeros(3); bre(1,1)=pieck*d11;bre(1,2)=pieck*d12; bre(1,3)=pieck*d13+rho*piecs; bre(2,1)=d11;bre(2,2)=d12;bre(2,3)=d13;bre(3,3)=rho; 'Learning in the RBC model is stable if all the following roots have real parts less than 1' inb=inv(eye(3)-mbet*bre); dtb=kron((inb*mdel)',(inb*mbet)); 'dtb roots' eig(dtb) dta=inb*mbet; 'dta roots' eig(dta)