0001 function rplot(s1)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 global M_ oo_ options_
0035
0036 rplottype = options_.rplottype;
0037
0038 col = ['y','c','r','g','b','w','m'] ;
0039 ix = [1 - M_.maximum_lag:size(oo_.endo_simul,2)-M_.maximum_lag]' ;
0040
0041 y = [];
0042 for k=1:size(s1,1)
0043 if isempty(strmatch(s1(k,:),M_.endo_names,'exact'))
0044 error (['One of the variable specified does not exist']) ;
0045 end
0046
0047 y = [y; oo_.endo_simul(strmatch(s1(k,:),M_.endo_names,'exact'),:)] ;
0048 end
0049
0050 if options_.smpl == 0
0051 i = [max(1, M_.maximum_lag):size(oo_.endo_simul,2)]' ;
0052 else
0053 i = [options_.smpl(1)+M_.maximum_lag:options_.smpl(2)+M_.maximum_lag]' ;
0054 end
0055
0056 t = ['Plot of '] ;
0057 if rplottype == 0
0058 for j = 1:size(y,1)
0059 t = [t s1(j,:) ' '] ;
0060 end
0061 figure ;
0062 plot(ix(i),y(:,i)) ;
0063 title (t,'Interpreter','none') ;
0064 xlabel('Periods') ;
0065 if size(s1,1) > 1
0066 if exist('OCTAVE_VERSION')
0067 legend(s1, 0);
0068 else
0069 h = legend(s1,0);
0070 set(h, 'Interpreter', 'none');
0071 end
0072 end
0073 elseif rplottype == 1
0074 for j = 1:size(y,1)
0075 figure ;
0076 plot(ix(i),y(j,i)) ;
0077 title(['Plot of ' s1(:,j)]) ;
0078 xlabel('Periods') ;
0079 end
0080 elseif rplottype == 2
0081 figure ;
0082 nl = max(1,fix(size(y,1)/4)) ;
0083 nc = ceil(size(y,1)/nl) ;
0084 for j = 1:size(y,1)
0085 subplot(nl,nc,j) ;
0086 plot(ix(i),y(j,i)) ;
0087 hold on ;
0088 plot(ix(i),oo_.steady_state(j)*ones(1,size(i,1)),'w:') ;
0089 xlabel('Periods') ;
0090 ylabel([s1(:,j)]) ;
0091 title(['Plot of ' s1(:,j)]) ;
0092 end
0093 end
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106