From f5c08fc0e8760690916c3f11debcf8b714ad25f6 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Tue, 31 May 2016 11:42:24 +0200 Subject: [PATCH] Create LaTeX output for Smirnov tests --- matlab/collect_LaTeX_Files.m | 12 +++++++++++- matlab/dynare_identification.m | 13 +++++++------ matlab/gsa/mcf_analysis.m | 19 +++++++++++++++---- matlab/plot_identification.m | 12 ++++++++++-- 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/matlab/collect_LaTeX_Files.m b/matlab/collect_LaTeX_Files.m index 223e3416d..6480500ee 100644 --- a/matlab/collect_LaTeX_Files.m +++ b/matlab/collect_LaTeX_Files.m @@ -9,7 +9,7 @@ function collect_LaTeX_Files(M_) % - The packages loaded enable pdflatex to run % - The _dynamic and _static TeX-model files are not included as they are standalone TeX-files -% Copyright (C) 2015-2016 Dynare Team +% Copyright (C) 2015-16 Dynare Team % % This file is part of Dynare. % @@ -79,6 +79,16 @@ for ii=1:length(TeX_Files) end end + +%% Identification/Output directory +TeX_Files=dir([M_.dname filesep 'identification' filesep 'Output' filesep M_.fname '*.TeX']); +for ii=1:length(TeX_Files) + [pathstr,f_name,ext] = fileparts(TeX_Files(ii).name); + if ~strcmp(TeX_Files(ii).name,f_name_binder) + fprintf(fid,'%s \n',['\include{', M_.dname '/identification/Output' '/',f_name,'}']); + end +end + %% GSA directory TeX_Files=dir([M_.dname filesep 'gsa' filesep M_.fname '*.tex']); for ii=1:length(TeX_Files) diff --git a/matlab/dynare_identification.m b/matlab/dynare_identification.m index d9b93679f..632139609 100644 --- a/matlab/dynare_identification.m +++ b/matlab/dynare_identification.m @@ -368,6 +368,7 @@ if iload <=0, return else parameters = 'Random_prior_params'; + parameters_TeX = 'Random prior parameter draw'; end end idehess_point.params=params; @@ -381,7 +382,7 @@ if iload <=0, save([IdentifDirectoryName '/' M_.fname '_' parameters '_identif.mat'], 'idehess_point', 'idemoments_point','idemodel_point', 'idelre_point','store_options_ident') disp_identification(params, idemodel_point, idemoments_point, name, advanced); if ~options_.nograph, - plot_identification(params,idemoments_point,idehess_point,idemodel_point,idelre_point,advanced,parameters,name,IdentifDirectoryName,parameters_TeX); + plot_identification(params,idemoments_point,idehess_point,idemodel_point,idelre_point,advanced,parameters,name,IdentifDirectoryName,parameters_TeX,name_tex); end if SampleSize > 1, @@ -556,7 +557,7 @@ if iload, disp(['Testing ',parameters]) disp_identification(idehess_point.params, idemodel_point, idemoments_point, name,advanced); if ~options_.nograph, - plot_identification(idehess_point.params,idemoments_point,idehess_point,idemodel_point,idelre_point,advanced,parameters,name,IdentifDirectoryName); + plot_identification(idehess_point.params,idemoments_point,idehess_point,idemodel_point,idelre_point,advanced,parameters,name,IdentifDirectoryName,[],name_tex); end end if SampleSize > 1, @@ -564,7 +565,7 @@ if SampleSize > 1, disp('Testing MC sample') disp_identification(pdraws, idemodel, idemoments, name); if ~options_.nograph, - plot_identification(pdraws,idemoments,idehess_point,idemodel,idelre,advanced,'MC sample ',name, IdentifDirectoryName); + plot_identification(pdraws,idemoments,idehess_point,idemodel,idelre,advanced,'MC sample ',name, IdentifDirectoryName,[],name_tex); end if advanced, jcrit=find(idemoments.ino); @@ -583,7 +584,7 @@ if SampleSize > 1, disp_identification(pdraws(jmax,:), idemodel_max, idemoments_max, name,1); close all, if ~options_.nograph, - plot_identification(pdraws(jmax,:),idemoments_max,idehess_max,idemodel_max,idelre_max,1,tittxt,name,IdentifDirectoryName,tittxt); + plot_identification(pdraws(jmax,:),idemoments_max,idehess_max,idemodel_max,idelre_max,1,tittxt,name,IdentifDirectoryName,tittxt,name_tex); end [dum,jmin]=min(idemoments.cond); fprintf('\n') @@ -598,7 +599,7 @@ if SampleSize > 1, disp_identification(pdraws(jmin,:), idemodel_min, idemoments_min, name,1); close all, if ~options_.nograph, - plot_identification(pdraws(jmin,:),idemoments_min,idehess_min,idemodel_min,idelre_min,1,tittxt,name,IdentifDirectoryName,tittxt); + plot_identification(pdraws(jmin,:),idemoments_min,idehess_min,idemodel_min,idelre_min,1,tittxt,name,IdentifDirectoryName,tittxt,name_tex); end else for j=1:length(jcrit), @@ -612,7 +613,7 @@ if SampleSize > 1, disp_identification(pdraws(jcrit(j),:), idemodel_(j), idemoments_(j), name,1); close all, if ~options_.nograph, - plot_identification(pdraws(jcrit(j),:),idemoments_(j),idehess_(j),idemodel_(j),idelre_(j),1,tittxt,name,IdentifDirectoryName,tittxt); + plot_identification(pdraws(jcrit(j),:),idemoments_(j),idehess_(j),idemodel_(j),idelre_(j),1,tittxt,name,IdentifDirectoryName,tittxt,name_tex); end end if ~iload, diff --git a/matlab/gsa/mcf_analysis.m b/matlab/gsa/mcf_analysis.m index cf7bcdae6..0b134e1a4 100644 --- a/matlab/gsa/mcf_analysis.m +++ b/matlab/gsa/mcf_analysis.m @@ -6,6 +6,7 @@ function indmcf = mcf_analysis(lpmat, ibeha, inobeha, options_mcf, DynareOptions % % Copyright (C) 2014 European Commission +% Copyright (C) 2016 Dynare Team % % This file is part of Dynare. % @@ -26,6 +27,7 @@ pvalue_ks = options_mcf.pvalue_ks; pvalue_corr = options_mcf.pvalue_corr; alpha2 = options_mcf.alpha2; param_names = options_mcf.param_names; +param_names_tex = options_mcf.param_names_tex; amcf_name = options_mcf.amcf_name; amcf_title = options_mcf.amcf_title; beha_title = options_mcf.beha_title; @@ -44,12 +46,21 @@ indmcf=find(proba10 && length(inobeha)>10, indcorr1 = stab_map_2(lpmat(ibeha,:),alpha2, pvalue_corr, beha_title); indcorr2 = stab_map_2(lpmat(inobeha,:),alpha2, pvalue_corr, nobeha_title); diff --git a/matlab/plot_identification.m b/matlab/plot_identification.m index dff9d8854..367262b0e 100644 --- a/matlab/plot_identification.m +++ b/matlab/plot_identification.m @@ -1,4 +1,4 @@ -function plot_identification(params,idemoments,idehess,idemodel, idelre, advanced, tittxt, name, IdentifDirectoryName,tit_TeX) +function plot_identification(params,idemoments,idehess,idemodel, idelre, advanced, tittxt, name, IdentifDirectoryName,tit_TeX,name_tex) % function plot_identification(params,idemoments,idehess,idemodel, idelre, advanced, tittxt, name, IdentifDirectoryName) % % INPUTS @@ -12,7 +12,7 @@ function plot_identification(params,idemoments,idehess,idemodel, idelre, advance % o name [char] list of names % o IdentifDirectoryName [char] directory name % o tittxt [char] TeX-name of the results to plot -% +% o name_tex [char] TeX-names of the parameters % OUTPUTS % None % @@ -38,6 +38,13 @@ function plot_identification(params,idemoments,idehess,idemodel, idelre, advance global M_ options_ +if nargin <10 || isempty(tit_TeX) + tit_TeX=tittxt; +end + +if nargin <11 + name_TeX=name; +end [SampleSize, nparam]=size(params); siJnorm = idemoments.siJnorm; @@ -358,6 +365,7 @@ else options_mcf.pvalue_corr = 0.001; options_mcf.alpha2 = 0; options_mcf.param_names = name; + options_mcf.param_names_tex = name_tex; options_mcf.fname_ = M_.fname; options_mcf.OutputDirectoryName = IdentifDirectoryName; options_mcf.beha_title = 'LOW condition nbr';