% Calibrated parameter values clear; beta=0.99; sigma=1; chi=1.55; eta=0; theta=2.064; omega=0.5; alpha=3; delta=1.5; rho=0.5; % Calculate kappa kappa=(1-omega)*(1-beta*omega)/(alpha*omega); % Define state space matrices A0=zeros(3,3); A0(1,1)=1; A0(2,2)=1; A0(2,3)=sigma^-1; A0(3,3)=beta; A1=zeros(3,3); A1(1,1)=rho; A1(2,1)=sigma^-1; A1(2,2)=1; A1(2,3)=sigma^-1*delta; A1(3,2)=-kappa; A1(3,3)=1; B0=zeros(3,1); B0(1,1)=1; % Calculate alternative state space matrices A=inv(A0)*A1; B=inv(A0)*B0; % Jordan decomposition of A [p,lambda] = eig(A); pstar = inv(p); % Sort eigenvalues and eigenvectors in ascending order val=diag(lambda); t=sortrows([val p'],1); lambda=diag(t(:,1)); p=t(:,2:4)'; pstar=inv(p); % Partition matrices LAMBDA1=lambda(1,1); LAMBDA2=lambda(2:3,2:3); P11=pstar(1,1); P12=pstar(1,2:3); P21=pstar(2:3,1); P22=pstar(2:3,2:3); R=pstar*B; % Print out matrices of recursive solution of model real(inv(P11-P12*inv(P22)*P21)*LAMBDA1*(P11-P12*inv(P22)*P21)) real(inv(P11-P12*inv(P22)*P21)*R(1)) real(-inv(P22)*P21)