%Compare IRFs from dynare with IRFs from state space

dynare rentalhousing ;

%From dynare
dynare_irf = oo_.irfs.data_YY_eps_j;
[result,eigenvalue_modulo,A,B,C,D]=ABCD_test(M_,options_,oo_,0); 
%From state space
C_tilde=C*pinv(A);
state_space = ssm(A,B,C_tilde,D-C_tilde*B) ;

responseY = irf(state_space) ;

state_space_irf=responseY(:,1,1) ; %third dimension represents shock 


plot(dynare_irf)
hold on 
plot(state_space_irf)
legend('dynare', 'state space')

