


GCOMPARE : GCOMPARE ( [ 'file1' ; 'file2' ] , [ 'var1' ; 'var2' ...] )
This optional command plots the trajectories of a list of
variables in two different simulations. One plot is drawn
for each variable. The trajectories must have been previously
saved by the instruction DYNASAVE. The simulation in file1
is refered to as the base simulation.

0001 function gcompare(s1,s2) 0002 % GCOMPARE : GCOMPARE ( [ 'file1' ; 'file2' ] , [ 'var1' ; 'var2' ...] ) 0003 % This optional command plots the trajectories of a list of 0004 % variables in two different simulations. One plot is drawn 0005 % for each variable. The trajectories must have been previously 0006 % saved by the instruction DYNASAVE. The simulation in file1 0007 % is refered to as the base simulation. 0008 0009 % Copyright (C) 2001-2010 Dynare Team 0010 % 0011 % This file is part of Dynare. 0012 % 0013 % Dynare is free software: you can redistribute it and/or modify 0014 % it under the terms of the GNU General Public License as published by 0015 % the Free Software Foundation, either version 3 of the License, or 0016 % (at your option) any later version. 0017 % 0018 % Dynare is distributed in the hope that it will be useful, 0019 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0020 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0021 % GNU General Public License for more details. 0022 % 0023 % You should have received a copy of the GNU General Public License 0024 % along with Dynare. If not, see <http://www.gnu.org/licenses/>. 0025 0026 global options_ M_ 0027 global nvx nvy x y lag1 0028 0029 ftest(s1,s2) ; 0030 0031 ix = [1-lag1(1):size(x,2)-lag1(1)]' ; 0032 i = [lag1(1):size(ix,1)-lag1(2)+1]' ; 0033 0034 if options_.smpl == 0 0035 i = [M_.maximum_lag:size(y,2)]' ; 0036 else 0037 i = [options_.smpl(1):options_.smpl(2)]' ; 0038 end 0039 0040 for k = 1:size(x,1) 0041 figure ; 0042 plot (ix(i),x(k,i),ix(i),y(k,i)) ; 0043 xlabel (['Periods']) ; 0044 title (['Variable ' s2(k,:)]) ; 0045 l = min(i) + 1; 0046 ll = max(i) - 1 ; 0047 text (l,x(k,l),s1(1,:)) ; 0048 text (ll,y(k,ll),s1(2,:)) ; 0049 end 0050 0051 % 06/18/01 MJ corrected treatment of options_.smpl 0052 % 06/24/01 MJ removed color specification 0053 0054 0055