Create LaTeX output for Smirnov tests
parent
9b82c72e4f
commit
f5c08fc0e8
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(proba<pvalue_ks);
|
|||
[tmp,jtmp] = sort(proba(indmcf),2,'ascend');
|
||||
indmcf = indmcf(jtmp);
|
||||
if ~isempty(indmcf)
|
||||
disp(['Smirnov statistics in driving ', title])
|
||||
for j=1:length(indmcf),
|
||||
disp([param_names(indmcf(j),:),' d-stat = ', num2str(dproba(indmcf(j)),'%1.3f'),' p-value = ', num2str(proba(indmcf(j)),'%1.3f')])
|
||||
end
|
||||
skipline()
|
||||
headers=char('Parameter','d-stat','p-value');
|
||||
labels=char(param_names(indmcf,:));
|
||||
data_mat=[dproba(indmcf)' proba(indmcf)'];
|
||||
options_temp.noprint=0;
|
||||
dyntable(options_temp,['Smirnov statistics in driving ', title],headers,labels,data_mat,size(labels,2)+2,16,3);
|
||||
if DynareOptions.TeX
|
||||
labels_TeX=param_names_tex(indmcf,:);
|
||||
M_temp.dname=OutputDirectoryName ;
|
||||
M_temp.fname=fname_;
|
||||
dyn_latex_table(M_temp,options_temp,['Smirnov statistics in driving ', title],amcf_name,headers,labels_TeX,data_mat,size(labels,2)+2,16,6);
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if length(ibeha)>10 && 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);
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue