Commit d3776363 authored by michel's avatar michel
Browse files

SWZ: adding identification/upper_cholesky.m

     cleaning up code


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3183 ac1d8469-bf42-47a9-8791-bf33cf982152
parent ff6f2a90
function [Ui,Vi,n0,np,ixmC0Pres] = upper_cholesky(lags,nvar,nexo,indxC0Pres)
Ui = cell(nvar,1);
Vi = cell(nvar,1);
n0 = zeros(nvar,1);
np = zeros(nvar,1);
if (nargin==2)
nexo = 1;
elseif (nargin==3)
indxC0Pres = 0;
end
k = lags*nvar+nexo;
Qi = zeros(nvar,nvar,nvar);
Ri = zeros(k,k,nvar);
for ii=2:nvar
Pi=diag(diag(ones(nvar-ii+1)),ii-1);
Qi(:,:,ii-1)=Pi(1:nvar,1:nvar);
Qi(:,:,nvar)=zeros(nvar,nvar);
end
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
ixmC0Pres = NaN;
\ No newline at end of file
......@@ -274,7 +274,7 @@ if options_.ms.indxestima
ye = [dateswd y];
%* Obtain linear restrictions
eval(['[Uiconst,Viconst,n0,np,ixmC0Pres] = ' options_.ms.restriction_fname '(options_.ms.nlags ,nvar,nexo,options_.ms.cross_restrictions );'])
[Uiconst,Viconst,n0,np,ixmC0Pres] = feval(options_.ms.restriction_fname,options_.ms.nlags ,nvar,nexo,options_.ms.cross_restrictions );
if min(n0)==0
disp(' ')
warning('A0: restrictions in dlrprior.m give no free parameter in one of equations')
......
......@@ -19,5 +19,5 @@ options.ms.output_file_tag = M.fname;
if ms_flag == 1
sz_prd(options)
else
swz_sbvar1(options);
swz_mardd(options);
end
function mz_sbvar(options_)
swz_mardd(options_); %to implement the second Matlab part of the file Instructions_swz_estimate.txt
\ No newline at end of file
......@@ -2,11 +2,9 @@ function sz_prd(options_)
%==========================================================================
%== Directory structure
%==========================================================================
% path for Zha's .m file library
%addpath './cstz';
% path for restriction .m files
%addpath './identification';
%generation of mhm file
generateMHM_input(options_);
swz_root = strrep(which('swz_sbvar'),'/swz_sbvar.m','');
......@@ -53,7 +51,9 @@ markov_file = [options_.ms.markov_file '.dat'];
%== Markov Process Specification File
%==========================================================================
%options_.ms.mhm_file = 'MHM_input.dat';
mhm_file = [options_.ms.mhm_file '.dat'];
mhm_file = [mhm_spec_path '/MHM_input.dat'];
%options_.ms.proposal_draws = 100000;
%==========================================================================
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment