Home > matlab > gsa > gsa_plotmatrix.m

gsa_plotmatrix

PURPOSE ^

function gsa_plotmatrix(type,varargin)

SYNOPSIS ^

function gsa_plotmatrix(type,varargin)

DESCRIPTION ^

 function gsa_plotmatrix(type,varargin)
 extended version of the standard MATLAB plotmatrix

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function gsa_plotmatrix(type,varargin)
0002 % function gsa_plotmatrix(type,varargin)
0003 % extended version of the standard MATLAB plotmatrix
0004 
0005 % Copyright (C) 2011-2012 Dynare Team
0006 %
0007 % This file is part of Dynare.
0008 %
0009 % Dynare is free software: you can redistribute it and/or modify
0010 % it under the terms of the GNU General Public License as published by
0011 % the Free Software Foundation, either version 3 of the License, or
0012 % (at your option) any later version.
0013 %
0014 % Dynare is distributed in the hope that it will be useful,
0015 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0016 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017 % GNU General Public License for more details.
0018 %
0019 % You should have received a copy of the GNU General Public License
0020 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0021 
0022 global bayestopt_ options_ M_
0023 
0024 RootDirectoryName = CheckPath('gsa',M_.dname);
0025 
0026 if options_.opt_gsa.pprior
0027     load([ RootDirectoryName filesep  M_.fname '_prior.mat'],'lpmat0','lpmat','istable','iunstable','iindeterm','iwrong')
0028 else
0029     load([ RootDirectoryName filesep  M_.fname '_mc.mat'],'lpmat0','lpmat','istable','iunstable','iindeterm','iwrong')
0030     eval(['load ' options_.mode_file ' xparam1;']');
0031 end
0032 
0033 iexplosive = iunstable(~ismember(iunstable,[iindeterm;iwrong]));
0034 
0035 switch type
0036     case 'all'
0037         x=[lpmat0 lpmat];
0038         NumberOfDraws=size(x,1);
0039         B=NumberOfDraws;
0040     case 'stable'
0041         x=[lpmat0(istable,:) lpmat(istable,:)];
0042         NumberOfDraws=size(x,1);
0043         B=NumberOfDraws;
0044     case 'nosolution'
0045         x=[lpmat0(iunstable,:) lpmat(iunstable,:)];
0046         NumberOfDraws=size(x,1);
0047         B=NumberOfDraws;
0048     case 'unstable'
0049         x=[lpmat0(iexplosive,:) lpmat(iexplosive,:)];
0050         NumberOfDraws=size(x,1);
0051         B=NumberOfDraws;
0052     case 'indeterm'
0053         x=[lpmat0(iindeterm,:) lpmat(iindeterm,:)];
0054         NumberOfDraws=size(x,1);
0055         B=NumberOfDraws;
0056     case 'wrong'
0057         x=[lpmat0(iwrong,:) lpmat(iwrong,:)];
0058         NumberOfDraws=size(x,1);
0059         B=NumberOfDraws;
0060         
0061 end
0062 
0063 if isempty(x),
0064     disp('Empty parameter set!')
0065     return
0066 end
0067 
0068 for j=1:length(varargin),
0069     jcol(j)=strmatch(varargin{j},bayestopt_.name,'exact');
0070 end
0071 
0072 [H,AX,BigA,P,PAx]=plotmatrix(x(:,jcol));
0073 
0074 for j=1:length(varargin),
0075     %      axes(AX(1,j)), title(varargin{j})
0076     %      axes(AX(j,1)), ylabel(varargin{j})
0077     %      set(AX(1,j),'title',varargin{j}),
0078     set(get(AX(j,1),'ylabel'),'string',varargin{j})
0079     set(get(AX(end,j),'xlabel'),'string',varargin{j})
0080 end
0081 
0082 if options_.opt_gsa.pprior==0,
0083     xparam1=xparam1(jcol);
0084     for j=1:length(varargin),
0085         for i=1:j-1,
0086             axes(AX(j,i)),
0087             hold on, plot(xparam1(i),xparam1(j),'*r')
0088         end
0089         for i=j+1:length(varargin),
0090             axes(AX(j,i)),
0091             hold on, plot(xparam1(i),xparam1(j),'*r')
0092         end
0093     end
0094 end

Generated on Mon 21-May-2012 02:42:43 by m2html © 2005