Home > matlab > kalman_transition_matrix.m

kalman_transition_matrix

PURPOSE ^

function [A,B] = kalman_transition_matrix(dr,iv,ic,exo_nbr)

SYNOPSIS ^

function [A,B] = kalman_transition_matrix(dr,iv,ic,exo_nbr)

DESCRIPTION ^

function [A,B] = kalman_transition_matrix(dr,iv,ic,exo_nbr)
 Builds the transition equation of the state space representation out of ghx and ghu for Kalman filter
 
 INPUTS
    dr:      structure of decisions rules for stochastic simulations
    iv:      selected variables
    ic:      state variables position in the transition matrix columns
    exo_nbr: number of exogenous variables
    
 OUTPUTS
    A:       matrix of predetermined variables effects in linear solution (ghx)
    B:       matrix of shocks effects in linear solution (ghu)
        
 SPECIAL REQUIREMENTS
    none

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [A,B] = kalman_transition_matrix(dr,iv,ic,exo_nbr)
0002 %function [A,B] = kalman_transition_matrix(dr,iv,ic,exo_nbr)
0003 % Builds the transition equation of the state space representation out of ghx and ghu for Kalman filter
0004 %
0005 % INPUTS
0006 %    dr:      structure of decisions rules for stochastic simulations
0007 %    iv:      selected variables
0008 %    ic:      state variables position in the transition matrix columns
0009 %    exo_nbr: number of exogenous variables
0010 %
0011 % OUTPUTS
0012 %    A:       matrix of predetermined variables effects in linear solution (ghx)
0013 %    B:       matrix of shocks effects in linear solution (ghu)
0014 %
0015 % SPECIAL REQUIREMENTS
0016 %    none
0017 
0018 % Copyright (C) 2003-2011 Dynare Team
0019 %
0020 % This file is part of Dynare.
0021 %
0022 % Dynare is free software: you can redistribute it and/or modify
0023 % it under the terms of the GNU General Public License as published by
0024 % the Free Software Foundation, either version 3 of the License, or
0025 % (at your option) any later version.
0026 %
0027 % Dynare is distributed in the hope that it will be useful,
0028 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0029 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0030 % GNU General Public License for more details.
0031 %
0032 % You should have received a copy of the GNU General Public License
0033 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0034 
0035 n_iv = length(iv);
0036 
0037 A = zeros(n_iv,n_iv);
0038 
0039 i_n_iv = 1:n_iv;
0040 A(i_n_iv,ic) = dr.ghx(iv,:);
0041 
0042 if nargout>1
0043     B = zeros(n_iv,exo_nbr);
0044     B(i_n_iv,:) = dr.ghu(iv,:);
0045 end
0046

Generated on Mon 21-May-2012 02:42:43 by m2html © 2005