Home > . > gcompare.m

gcompare

PURPOSE ^

Copyright (C) 2001 Michel Juillard

SYNOPSIS ^

function gcompare(s1,s2)

DESCRIPTION ^

 Copyright (C) 2001 Michel Juillard

 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.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Copyright (C) 2001 Michel Juillard
0002 %
0003 function gcompare(s1,s2)
0004 % GCOMPARE :    GCOMPARE ( [ 'file1' ; 'file2' ] , [ 'var1' ; 'var2' ...] )
0005 %        This optional command plots the trajectories of a list of
0006 %        variables in two different simulations. One plot is drawn
0007 %        for each variable. The trajectories must have been previously
0008 %        saved by the instruction DYNASAVE. The simulation in file1
0009 %        is refered to as the base simulation.
0010 
0011 
0012 global options_ M_
0013 global nvx nvy x y lag1
0014 
0015 ftest(s1,s2) ;
0016 
0017 ix = [1-lag1(1):size(x,2)-lag1(1)]' ;
0018 i = [lag1(1):size(ix,1)-lag1(2)+1]' ;
0019 
0020 if options_.smpl == 0
0021         i = [M_.maximum_lag:size(y,2)]' ;
0022 else
0023     i = [options_.smpl(1):options_.smpl(2)]' ;
0024 end
0025 
0026 for k = 1:size(x,1)
0027     figure ;
0028     plot (ix(i),x(k,i),ix(i),y(k,i)) ;
0029     xlabel (['Periods']) ;
0030     title (['Variable ' s2(k,:)]) ;
0031     l = min(i) + 1;
0032     ll = max(i) - 1 ;
0033     text (l,x(k,l),s1(1,:)) ;
0034     text (ll,y(k,ll),s1(2,:)) ;
0035 end
0036 
0037 % 06/18/01 MJ corrected treatment of options_.smpl
0038 % 06/24/01 MJ removed color specification
0039 
0040 
0041

Generated on Fri 16-Jun-2006 09:09:06 by m2html © 2003