1) Allow threshold reduced form mapping also for posterior samples;

2) Improve the notation of info saved of  threshold reduced form mapping which was obscure.
time-shift
Marco Ratto 2013-04-11 10:09:21 +02:00
parent b0f9131f13
commit b77445e5f9
2 changed files with 40 additions and 16 deletions

View File

@ -233,8 +233,32 @@ if options_gsa.identification,
map_ident_(OutputDirectoryName,options_gsa);
end
if options_gsa.redform && ~isempty(options_gsa.namendo) ...
&& ~options_gsa.ppost,
if options_gsa.redform && ~isempty(options_gsa.namendo),% ...
% && ~options_gsa.ppost,
if options_gsa.ppost,
filnam = dir([M_.dname filesep 'metropolis' filesep '*param_irf*.mat']);
lpmat=[];
for j=1:length(filnam),
load ([M_.dname filesep 'metropolis' filesep M_.fname '_param_irf' int2str(j) '.mat'])
lpmat=[lpmat; stock];
end
clear stock
nshock = estim_params_.nvx;
nshock = nshock + estim_params_.nvn;
nshock = nshock + estim_params_.ncx;
nshock = nshock + estim_params_.ncn;
lpmat0=lpmat(:,1:nshock);
lpmat=lpmat(:,nshock+1:end);
istable=(1:size(lpmat,1));
iunstable=[];
iwrong=[];
iindeterm=[];
save([OutputDirectoryName filesep M_.fname '_mc.mat'],'lpmat','lpmat0','istable','iunstable','iwrong','iindeterm')
options_gsa.load_stab=1;
x0 = stab_map_(OutputDirectoryName,options_gsa);
end
if strmatch(':',options_gsa.namendo,'exact'),
options_gsa.namendo=M_.endo_names;
end

View File

@ -134,7 +134,7 @@ for j=1:size(anamendo,1)
else
iy=find( (y0>threshold(1)) & (y0<threshold(2)));
iyc=find( (y0<=threshold(1)) | (y0>=threshold(2)));
xdir = [xdir0,'_cut'];
xdir = [xdir0,'_threshold'];
if isempty(dir(xdir))
mkdir(xdir)
end
@ -148,21 +148,21 @@ for j=1:size(anamendo,1)
si(:,js) = NaN(np,1);
% end
if ~isempty(iy) && ~isempty(iyc)
delete([xdir, '/*cut*.*'])
[proba, dproba] = stab_map_1(x0, iy, iyc, 'cut',0);
delete([xdir, '/*threshold*.*'])
[proba, dproba] = stab_map_1(x0, iy, iyc, 'threshold',0);
% indsmirnov = find(dproba>ksstat);
indsmirnov = find(proba<pvalue_ks);
for jp=1:length(indsmirnov),
disp([M_.param_names(estim_params_.param_vals(indsmirnov(jp),1),:),' d-stat = ', num2str(dproba(indsmirnov(jp)),'%1.3f'),' p-value = ', num2str(proba(indsmirnov(jp)),'%1.3f')])
end
disp(' ');
stab_map_1(x0, iy, iyc, 'cut',1,indsmirnov,xdir);
stab_map_2(x0(iy,:),alpha2,pvalue_corr,'cut',xdir)
stab_map_2(x0(iyc,:),alpha2,pvalue_corr,'trim',xdir)
stab_map_1(x0, iy, iyc, 'threshold',1,indsmirnov,xdir);
stab_map_2(x0(iy,:),alpha2,pvalue_corr,'inside_threshold',xdir)
stab_map_2(x0(iyc,:),alpha2,pvalue_corr,'outside_threshold',xdir)
lpmat=x0(iy,:);
lpmat0=xx0(iy,:);
istable=[1:length(iy)];
save([xdir,filesep,'threshold.mat'],'lpmat','lpmat0','istable')
save([xdir,filesep,'threshold.mat'],'lpmat','lpmat0','istable','y0','x0','xx0','iy','iyc')
clear lpmat lpmat0 istable
end
end
@ -233,7 +233,7 @@ for j=1:size(anamendo,1)
else
iy=find( (y0>threshold(1)) & (y0<threshold(2)));
iyc=find( (y0<=threshold(1)) | (y0>=threshold(2)));
xdir = [xdir0,'_cut'];
xdir = [xdir0,'_threshold'];
if isempty(dir(xdir))
mkdir(xdir)
end
@ -245,21 +245,21 @@ for j=1:size(anamendo,1)
dyn_saveas(hf,[xdir,'/', namendo,'_vs_', namlagendo],options_);
end
if ~isempty(iy) && ~isempty(iyc),
delete([xdir, '/*cut*.*'])
[proba, dproba] = stab_map_1(x0, iy, iyc, 'cut',0);
delete([xdir, '/*threshold*.*'])
[proba, dproba] = stab_map_1(x0, iy, iyc, 'threshold',0);
% indsmirnov = find(dproba>ksstat);
indsmirnov = find(proba<pvalue_ks);
for jp=1:length(indsmirnov),
disp([M_.param_names(estim_params_.param_vals(indsmirnov(jp),1),:),' d-stat = ', num2str(dproba(indsmirnov(jp)),'%1.3f'),' p-value = ', num2str(proba(indsmirnov(jp)),'%1.3f')])
end
disp(' ');
stab_map_1(x0, iy, iyc, 'cut',1,indsmirnov,xdir);
stab_map_2(x0(iy,:),alpha2,pvalue_corr,'cut',xdir)
stab_map_2(x0(iyc,:),alpha2,pvalue_corr,'trim',xdir)
stab_map_1(x0, iy, iyc, 'threshold',1,indsmirnov,xdir);
stab_map_2(x0(iy,:),alpha2,pvalue_corr,'inside_threshold',xdir)
stab_map_2(x0(iyc,:),alpha2,pvalue_corr,'outside_threshold',xdir)
lpmat=x0(iy,:);
lpmat0=xx0(iy,:);
istable=[1:length(iy)];
save([xdir,filesep,'threshold.mat'],'lpmat','lpmat0','istable')
save([xdir,filesep,'threshold.mat'],'lpmat','lpmat0','istable','y0','x0','xx0','iy','iyc')
clear lpmat lpmat0 istable
end