98 lines
5.3 KiB
HTML
98 lines
5.3 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 olr1</title>
|
||
|
<meta name="keywords" content="olr1">
|
||
|
<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> > olr1.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>olr1
|
||
|
</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 dr = olr1(ys,algo,olr_inst,bet,obj_var,W) </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</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)">
|
||
|
<li><a href="check.html" class="code" title="function result = check">check</a> Copyright (C) 2001 Michel Juillard</li><li><a href="dynare_solve.html" class="code" title="function [x,cheik] = dynare_solve(func,x,jacobian_flag,varargin)">dynare_solve</a> Copyright (C) 2001 Michel Juillard</li><li><a href="olr2.html" class="code" title="function dr=olr2(dr,olr_inst,bet,obj_var,W)">olr2</a> Copyright (C) 2003 Michel Juillard</li></ul>
|
||
|
This function is called by:
|
||
|
<ul style="list-style-image:url(../matlabicon.gif)">
|
||
|
<li><a href="olr.html" class="code" title="function olr(var_list,olr_inst,obj_var,W)">olr</a> Copyright (C) 2001 Michel Juillard</li></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 dr = olr1(ys,algo,olr_inst,bet,obj_var,W)</a>
|
||
|
0004
|
||
|
0005 <span class="keyword">global</span> M_ options_ oo_
|
||
|
0006 <span class="keyword">global</span> it_ means_ stderrs_
|
||
|
0007
|
||
|
0008 xlen = M_.maximum_lead + M_.maximum_lag + 1;
|
||
|
0009 klen = M_.maximum_lag + M_.maximum_lead + 1;
|
||
|
0010 iyv = M_.lead_lag_incidence';
|
||
|
0011 iyv = iyv(:);
|
||
|
0012 iyr0 = find(iyv) ;
|
||
|
0013 it_ = M_.maximum_lag + 1 ;
|
||
|
0014
|
||
|
0015
|
||
|
0016 <span class="keyword">if</span> M_.exo_nbr == 0
|
||
|
0017 oo_.exo_steady_state = [] ;
|
||
|
0018 <span class="keyword">end</span>
|
||
|
0019
|
||
|
0020 <span class="keyword">if</span> ~ M_.lead_lag_incidence(M_.maximum_lag+1,:) > 0
|
||
|
0021 error (<span class="string">'OLR: Error in model specification: some variables don"t appear as current'</span>) ;
|
||
|
0022 <span class="keyword">end</span>
|
||
|
0023
|
||
|
0024 <span class="keyword">if</span> M_.maximum_lead == 0
|
||
|
0025 error (<span class="string">'Backward or static model: no point in using OLR'</span>) ;
|
||
|
0026 <span class="keyword">end</span>
|
||
|
0027
|
||
|
0028 <span class="keyword">if</span> xlen > 1
|
||
|
0029 error ([<span class="string">'OLR: stochastic exogenous variables must appear only at the'</span> <span class="keyword">...</span>
|
||
|
0030 <span class="string">' current period. Use additional endogenous variables'</span>]) ;
|
||
|
0031 <span class="keyword">end</span>
|
||
|
0032
|
||
|
0033 <span class="comment">% check if ys is steady state</span>
|
||
|
0034 tempex = oo_.exo_simul;
|
||
|
0035 oo_.exo_simul = oo_.exo_steady_state';
|
||
|
0036 fh = str2func([M_.fname <span class="string">'_static'</span>]);
|
||
|
0037 <span class="keyword">if</span> max(abs(feval(fh,ys))) > options_.dynatol
|
||
|
0038 [dr.ys, <a href="check.html" class="code" title="function result = check">check</a>] = <a href="dynare_solve.html" class="code" title="function [x,cheik] = dynare_solve(func,x,jacobian_flag,varargin)">dynare_solve</a>([M_.fname <span class="string">'_static'</span>],ys);
|
||
|
0039 <span class="keyword">if</span> <a href="check.html" class="code" title="function result = check">check</a>
|
||
|
0040 error(<span class="string">'OLR: convergence problem in DYNARE_SOLVE'</span>)
|
||
|
0041 <span class="keyword">end</span>
|
||
|
0042 <span class="keyword">else</span>
|
||
|
0043 dr.ys = ys;
|
||
|
0044 <span class="keyword">end</span>
|
||
|
0045 dr = <a href="olr2.html" class="code" title="function dr=olr2(dr,olr_inst,bet,obj_var,W)">olr2</a>(dr,olr_inst,bet,obj_var,W);
|
||
|
0046 oo_.exo_simul = tempex;
|
||
|
0047 tempex = [];
|
||
|
0048
|
||
|
0049 <span class="comment">% 04/13/03 MJ</span>
|
||
|
0050
|
||
|
0051
|
||
|
0052</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>
|