0001
0002 function stab_map_2(x,alpha2,fnam, dirname)
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 global bayestopt_ estim_params_ options_ oo_ M_
0018
0019 npar=size(x,2);
0020 ishock= npar>estim_params_.np;
0021 if nargin<3,
0022 fnam='';
0023 end
0024 if nargin<4,
0025 dirname='';
0026 end
0027
0028 ys_ = oo_.dr.ys;
0029 dr_ = oo_.dr;
0030 fname_ = M_.fname;
0031 nshock = estim_params_.nvx;
0032 nshock = nshock + estim_params_.nvn;
0033 nshock = nshock + estim_params_.ncx;
0034 nshock = nshock + estim_params_.ncn;
0035
0036 c0=corrcoef(x);
0037 c00=tril(c0,-1);
0038 fig_nam_=[fname_,'_',fnam,'_corr_'];
0039
0040 ifig=0;
0041 j2=0;
0042 if ishock==0
0043 npar=estim_params_.np;
0044 else
0045 npar=estim_params_.np+nshock;
0046 end
0047 for j=1:npar,
0048 i2=find(abs(c00(:,j))>alpha2);
0049 if length(i2)>0,
0050 for jx=1:length(i2),
0051 j2=j2+1;
0052 if mod(j2,12)==1,
0053 ifig=ifig+1;
0054 figure('name',['Correlations in the ',fnam,' sample ', num2str(ifig)]),
0055 end
0056 subplot(3,4,j2-(ifig-1)*12)
0057
0058
0059
0060
0061
0062 plot(x(:,j),x(:,i2(jx)),'.')
0063
0064
0065 if ishock,
0066 xlabel(bayestopt_.name{j},'interpreter','none'),
0067 ylabel(bayestopt_.name{i2(jx)},'interpreter','none'),
0068 else
0069 xlabel(bayestopt_.name{j+nshock},'interpreter','none'),
0070 ylabel(bayestopt_.name{i2(jx)+nshock},'interpreter','none'),
0071 end
0072 title(['cc = ',num2str(c0(i2(jx),j))])
0073 if (mod(j2,12)==0) & j2>0,
0074 saveas(gcf,[dirname,'\',fig_nam_,int2str(ifig)])
0075 eval(['print -depsc2 ' dirname '\' fig_nam_ int2str(ifig)]);
0076 eval(['print -dpdf ' dirname '\' fig_nam_ int2str(ifig)]);
0077 if options_.nograph, close(gcf), end
0078 end
0079 end
0080 end
0081 if (j==(npar)) & j2>0,
0082 saveas(gcf,[dirname,'\',fig_nam_,int2str(ifig)])
0083 eval(['print -depsc2 ' dirname '\' fig_nam_ int2str(ifig)]);
0084 eval(['print -dpdf ' dirname '\' fig_nam_ int2str(ifig)]);
0085 if options_.nograph, close(gcf), end
0086 end
0087
0088 end
0089 if ifig==0,
0090 disp(['No correlation term >', num2str(alpha2),' found for ',fnam])
0091 end
0092