⇤ ← Revision 1 as of 20091201 11:28:50
2635
Comment:

2635

Deletions are marked like this.  Additions are marked like this. 
Line 66:  Line 66: 
In Matlab, we need a function {{{swz/identification/exclusions.m}}}, similar of {{{swz/identification/upper_choleski.m}}} that is called when exclusions are specified instead of {{{upper_choleski}}} or {{{lower_choleski}}}  In Matlab, we need a function {{{swz/identification/exclusions.m}}}, similar of {{{swz/identification/upper_cholesky.m}}} that is called when exclusions are specified instead of {{{upper_cholesky}}} or {{{lower_cholesky}}} 
Line 83:  Line 83: 
It is also necessary to write {{{swz/identification/lower_choleski.m}}}  It is also necessary to write {{{swz/identification/lower_cholesky.m}}} 
Interface for SVAR exculsion restrictions
Model
where y_{t} is a vector of n endogenous variables, r is the maximum lag length, z a vector of m exogenous variables (only a constant for the time being).
Note that each equation corresponds to the columns of A_{i}, i=0,...,r.
The model can be written in a more compact form
where
Exculsion Restrictions
Restricitions are defined with Q_{i} and R_{i} matrices for each column of A_{0} and A_{+} respectively.
Q and R matrices are made of 0 and 1 such that
Q_{i} matrices have n columns and as many rows as there are restrictions.
R_{i} matrices have k=r*n+m columns and as many rows as there are restrictions.
Dynare implementation
The Q_{i} and R_{i} matrices are stored in 3dimensional arrays: Qi' and Ri'
Qi = zeros(n,n,n); Ri = zeros(k,k,n);
For each exculsion of variable y_{t,j} in equation i
Qi(h,j,i) = 1;
where h is the number of the restriction in equation i in A_{0}
For each exculsion of variable y_{tp,j} in equation i
Ri(h,(p2)*n+j,i) = 1;
where h is the number of the restriction in equation i in A_{+}
The above should be implemented in the preprocessor that should create options_.ms.Qi and options_.ms.Ri [these names may collide with restriction on Markov processes. We will need to check later]
In Matlab, we need a function swz/identification/exclusions.m, similar of swz/identification/upper_cholesky.m that is called when exclusions are specified instead of upper_cholesky or lower_cholesky
The only code needed in this function is
%make local copy in order not to call structure fields inside a loop Qi = options_.ms.Qi; Ri = options_.ms.Ri; for n=1:nvar Ui(n) = null(Qi(:,:,n)); Vi(n) = null(Ri(:,:,n)); n0(n) = size(Ui(n),2); np(n) = size(Vi(n),2); end
ixmCoPres = NaN; }}}
It is also necessary to write swz/identification/lower_cholesky.m