Skip to content
Snippets Groups Projects
Commit e8b6a04e authored by stepan's avatar stepan
Browse files

* Cosmetic changes.

* Do not compute B if not needed.



git-svn-id: https://www.dynare.org/svn/dynare/trunk@3167 ac1d8469-bf42-47a9-8791-bf33cf982152
parent a2cef700
No related branches found
No related tags found
No related merge requests found
function [A,B,ys,info] = dynare_resolve(iv,ic,aux)
% function [A,B,ys,info] = dynare_resolve(iv,ic,aux)
% Computes the linear approximation and the matrices A and B of the
% transition equation
......@@ -47,8 +46,12 @@ function [A,B,ys,info] = dynare_resolve(iv,ic,aux)
if info(1) > 0
A = [];
if nargout>1
B = [];
if nargout>2
ys = [];
end
end
return
end
......@@ -64,5 +67,10 @@ function [A,B,ys,info] = dynare_resolve(iv,ic,aux)
aux(k,2) = aux(k,2) + oo_.dr.nfwrd;
end
if nargout==1
A = kalman_transition_matrix(oo_.dr,iv,ic,aux,M_.exo_nbr);
return
end
[A,B] = kalman_transition_matrix(oo_.dr,iv,ic,aux,M_.exo_nbr);
ys = oo_.dr.ys;
\ No newline at end of file
......@@ -37,7 +37,6 @@ function [A,B] = kalman_transition_matrix(dr,iv,ic,aux,exo_nbr)
nr = n_iv + n_ir1;
A = zeros(nr,nr);
B = zeros(nr,exo_nbr);
i_n_iv = 1:n_iv;
A(i_n_iv,ic) = dr.ghx(iv,:);
......@@ -45,8 +44,10 @@ function [A,B] = kalman_transition_matrix(dr,iv,ic,aux,exo_nbr)
A(n_iv+1:end,:) = sparse(aux(:,1),aux(:,2),ones(n_ir1,1),n_ir1,nr);
end
if nargout>1
B = zeros(nr,exo_nbr);
B(i_n_iv,:) = dr.ghu(iv,:);
end
% $$$ function [A,B] = kalman_transition_matrix(dr)
% $$$ global M_
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment