


function [Ui,Vi,n0,np,ixmC0Pres] = upper_cholesky(nvar,nexo,options_ms)
INPUTS
nvar: number endogenous variables
nexo: number exogenous variables
options_ms: (struct) options
OUTPUTS
Ui
Vi
n0
np
ixmC0Pres
SPECIAL REQUIREMENTS
none

0001 function [Ui,Vi,n0,np,ixmC0Pres] = upper_cholesky(nvar,nexo,options_ms) 0002 % function [Ui,Vi,n0,np,ixmC0Pres] = upper_cholesky(nvar,nexo,options_ms) 0003 % 0004 % INPUTS 0005 % nvar: number endogenous variables 0006 % nexo: number exogenous variables 0007 % options_ms: (struct) options 0008 % 0009 % OUTPUTS 0010 % Ui 0011 % Vi 0012 % n0 0013 % np 0014 % ixmC0Pres 0015 % 0016 % SPECIAL REQUIREMENTS 0017 % none 0018 0019 % Copyright (C) 2011 Dynare Team 0020 % 0021 % This file is part of Dynare. 0022 % 0023 % Dynare is free software: you can redistribute it and/or modify 0024 % it under the terms of the GNU General Public License as published by 0025 % the Free Software Foundation, either version 3 of the License, or 0026 % (at your option) any later version. 0027 % 0028 % Dynare is distributed in the hope that it will be useful, 0029 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0030 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0031 % GNU General Public License for more details. 0032 % 0033 % You should have received a copy of the GNU General Public License 0034 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0035 0036 lags = options_ms.nlags; 0037 indxC0Pres = options_ms.cross_restrictions; 0038 0039 Ui = cell(nvar,1); 0040 Vi = cell(nvar,1); 0041 n0 = zeros(nvar,1); 0042 np = zeros(nvar,1); 0043 0044 if (nargin==2) 0045 nexo = 1; 0046 elseif (nargin==3) 0047 indxC0Pres = 0; 0048 end 0049 0050 k = lags*nvar+nexo; 0051 Qi = zeros(nvar,nvar,nvar); 0052 Ri = zeros(k,k,nvar); 0053 0054 for ii=2:nvar 0055 Qi(ii-1,ii-1,ii)=1; 0056 Qi(:,:,ii)=Qi(:,:,ii)+Qi(:,:,ii-1); 0057 end 0058 0059 if options_ms.constants_exclusion 0060 for i=1:nvar 0061 Ri(i,k,i) = 1; 0062 end 0063 end 0064 0065 for n=1:nvar 0066 Ui{n} = null(Qi(:,:,n)); 0067 Vi{n} = null(Ri(:,:,n)); 0068 n0(n) = size(Ui{n},2); 0069 np(n) = size(Vi{n},2); 0070 end 0071 0072 ixmC0Pres = NaN;