129 lines
6.0 KiB
HTML
129 lines
6.0 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||
|
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Description of rplot</title>
|
||
|
<meta name="keywords" content="rplot">
|
||
|
<meta name="description" content="Copyright (C) 2001 Michel Juillard">
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||
|
<meta name="generator" content="m2html © 2003 Guillaume Flandin">
|
||
|
<meta name="robots" content="index, follow">
|
||
|
<link type="text/css" rel="stylesheet" href="../m2html.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<a name="_top"></a>
|
||
|
<div><a href="../index.html">Home</a> > <a href="index.html">.</a> > rplot.m</div>
|
||
|
|
||
|
<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td>
|
||
|
<td align="right"><a href="index.html">Index for . <img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
|
||
|
|
||
|
<h1>rplot
|
||
|
</h1>
|
||
|
|
||
|
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="box"><strong>Copyright (C) 2001 Michel Juillard</strong></div>
|
||
|
|
||
|
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="box"><strong>function rplot(s1) </strong></div>
|
||
|
|
||
|
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="fragment"><pre class="comment"> Copyright (C) 2001 Michel Juillard
|
||
|
|
||
|
RPLOT : RPLOT ( ['var1'; 'var2'; ...] )
|
||
|
This optionnal command creates the plot of the variable
|
||
|
trajectory. By default, the entire simulation period is
|
||
|
ploted. The instruction DSAMPLE permits to reduce the
|
||
|
number of periods in the plot.</pre></div>
|
||
|
|
||
|
<!-- crossreference -->
|
||
|
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
This function calls:
|
||
|
<ul style="list-style-image:url(../matlabicon.gif)">
|
||
|
</ul>
|
||
|
This function is called by:
|
||
|
<ul style="list-style-image:url(../matlabicon.gif)">
|
||
|
</ul>
|
||
|
<!-- crossreference -->
|
||
|
|
||
|
|
||
|
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="fragment"><pre>0001 <span class="comment">% Copyright (C) 2001 Michel Juillard</span>
|
||
|
0002 <span class="comment">%</span>
|
||
|
0003 <a name="_sub0" href="#_subfunctions" class="code">function rplot(s1)</a>
|
||
|
0004 <span class="comment">% RPLOT : RPLOT ( ['var1'; 'var2'; ...] )</span>
|
||
|
0005 <span class="comment">% This optionnal command creates the plot of the variable</span>
|
||
|
0006 <span class="comment">% trajectory. By default, the entire simulation period is</span>
|
||
|
0007 <span class="comment">% ploted. The instruction DSAMPLE permits to reduce the</span>
|
||
|
0008 <span class="comment">% number of periods in the plot.</span>
|
||
|
0009
|
||
|
0010 <span class="keyword">global</span> M_ oo_ options_
|
||
|
0011
|
||
|
0012 rplottype = options_.rplottype;
|
||
|
0013
|
||
|
0014 col = [<span class="string">'y'</span>,<span class="string">'c'</span>,<span class="string">'r'</span>,<span class="string">'g'</span>,<span class="string">'b'</span>,<span class="string">'w'</span>,<span class="string">'m'</span>] ;
|
||
|
0015 ix = [1 - M_.maximum_lag:size(oo_.y_simul,2)-M_.maximum_lag]' ;
|
||
|
0016
|
||
|
0017 y = [];
|
||
|
0018 <span class="keyword">for</span> k=1:size(s1,1)
|
||
|
0019 <span class="keyword">if</span> isempty(strmatch(s1(k,:),M_.endo_names,<span class="string">'exact'</span>))
|
||
|
0020 error ([<span class="string">'One of the variable specified does not exist'</span>]) ;
|
||
|
0021 <span class="keyword">end</span>
|
||
|
0022
|
||
|
0023 y = [y; oo_.y_simul(strmatch(s1(k,:),M_.endo_names,<span class="string">'exact'</span>),:)] ;
|
||
|
0024 <span class="keyword">end</span>
|
||
|
0025
|
||
|
0026 <span class="keyword">if</span> options_.smpl == 0
|
||
|
0027 i = [M_.maximum_lag:size(oo_.y_simul,2)]' ;
|
||
|
0028 <span class="keyword">else</span>
|
||
|
0029 i = [options_.smpl(1)+M_.maximum_lag:options_.smpl(2)+M_.maximum_lag]' ;
|
||
|
0030 <span class="keyword">end</span>
|
||
|
0031
|
||
|
0032 t = [<span class="string">'Plot of '</span>] ;
|
||
|
0033 <span class="keyword">if</span> rplottype == 0
|
||
|
0034 <span class="keyword">for</span> j = 1:size(y,1)
|
||
|
0035 t = [t s1(j,:) <span class="string">' '</span>] ;
|
||
|
0036 <span class="keyword">end</span>
|
||
|
0037 figure ;
|
||
|
0038 plot(ix(i),y(:,i)) ;
|
||
|
0039 title (t,<span class="string">'Interpreter'</span>,<span class="string">'none'</span>) ;
|
||
|
0040 xlabel(<span class="string">'Periods'</span>) ;
|
||
|
0041 <span class="keyword">if</span> size(s1,1) > 1
|
||
|
0042 legend(s1,0);
|
||
|
0043 <span class="keyword">end</span>
|
||
|
0044 <span class="keyword">elseif</span> rplottype == 1
|
||
|
0045 <span class="keyword">for</span> j = 1:size(y,1)
|
||
|
0046 figure ;
|
||
|
0047 plot(ix(i),y(j,i)) ;
|
||
|
0048 title([<span class="string">'Plot of '</span> s1(:,j)]) ;
|
||
|
0049 xlabel(<span class="string">'Periods'</span>) ;
|
||
|
0050 <span class="keyword">end</span>
|
||
|
0051 <span class="keyword">elseif</span> rplottype == 2
|
||
|
0052 figure ;
|
||
|
0053 nl = max(1,fix(size(y,1)/4)) ;
|
||
|
0054 nc = ceil(size(y,1)/nl) ;
|
||
|
0055 <span class="keyword">for</span> j = 1:size(y,1)
|
||
|
0056 subplot(nl,nc,j) ;
|
||
|
0057 plot(ix(i),y(j,i)) ;
|
||
|
0058 hold on ;
|
||
|
0059 plot(ix(i),oo_.steady_state(j)*ones(1,size(i,1)),<span class="string">'w:'</span>) ;
|
||
|
0060 xlabel(<span class="string">'Periods'</span>) ;
|
||
|
0061 ylabel([s1(:,j)]) ;
|
||
|
0062 title([<span class="string">'Plot of '</span> s1(:,j)]) ;
|
||
|
0063 <span class="keyword">end</span>
|
||
|
0064 <span class="keyword">end</span>
|
||
|
0065
|
||
|
0066 <span class="comment">% 02/28/01 MJ replaced bseastr by MATLAB's strmatch</span>
|
||
|
0067 <span class="comment">% 06/19/01 MJ added 'exact' to strmatch calls</span>
|
||
|
0068 <span class="comment">% 06/25/03 MJ correction when options_.smpl ~= 0</span>
|
||
|
0069
|
||
|
0070
|
||
|
0071
|
||
|
0072
|
||
|
0073
|
||
|
0074
|
||
|
0075
|
||
|
0076
|
||
|
0077</pre></div>
|
||
|
<hr><address>Generated on Fri 16-Jun-2006 09:09:06 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address>
|
||
|
</body>
|
||
|
</html>
|