128 lines
8.7 KiB
HTML
128 lines
8.7 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 resol</title>
|
|
<meta name="keywords" content="resol">
|
|
<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> > resol.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>resol
|
|
</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,info]=resol(ys,check_flag) </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="dr1.html" class="code" title="function [dr,info]=dr1(dr,task)">dr1</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="resid.html" class="code" title="function resid(period)">resid</a> Copyright (C) 2001 Michel Juillard</li><li><a href="set_default_option.html" class="code" title="function options=set_default_option(options,field,default)">set_default_option</a> </li></ul>
|
|
This function is called by:
|
|
<ul style="list-style-image:url(../matlabicon.gif)">
|
|
<li><a href="PosteriorIRF.html" class="code" title="function PosteriorIRF(type)">PosteriorIRF</a> stephane.adjemian@ens.fr [09-25-2005]</li><li><a href="PosteriorSmoother.html" class="code" title="function PosteriorSmoother(Y,gend, type)">PosteriorSmoother</a> stephane.adjemian@ens.fr [09-25-2005]</li><li><a href="calib.html" class="code" title="function M_.Sigma_e = calib(var_indices,targets,var_weights,nar,cova,M_.Sigma_e)">calib</a> </li><li><a href="check.html" class="code" title="function result = check">check</a> Copyright (C) 2001 Michel Juillard</li><li><a href="dynare_resolve.html" class="code" title="function [A,B,ys,info] = dynare_resolve()">dynare_resolve</a> </li><li><a href="osr1.html" class="code" title="function oo_.dr=osr1(params,weights)">osr1</a> </li><li><a href="osr_obj.html" class="code" title="function [z,vx]=osr_obj(x,params,weights);">osr_obj</a> the beginning and the end of this function may be adapted by the userx</li><li><a href="stoch_simul.html" class="code" title="function info=stoch_simul(var_list)">stoch_simul</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,info]=resol(ys,check_flag)</a>
|
|
0004 <span class="keyword">global</span> M_ options_ oo_
|
|
0005 <span class="comment">% info: same as dr1</span>
|
|
0006 <span class="keyword">global</span> it_
|
|
0007 <span class="comment">% plus:</span>
|
|
0008 <span class="comment">% 11 .... same as dr1 for dr_algo = 2</span>
|
|
0009 <span class="comment">% 20: can't find steady state info(2) contains sum of sqare residuals</span>
|
|
0010
|
|
0011
|
|
0012 <span class="comment">%unfinished</span>
|
|
0013 jacobian_flag = 0;
|
|
0014
|
|
0015 options_ = <a href="set_default_option.html" class="code" title="function options=set_default_option(options,field,default)">set_default_option</a>(options_,<span class="string">'olr'</span>,0);
|
|
0016 options_ = <a href="set_default_option.html" class="code" title="function options=set_default_option(options,field,default)">set_default_option</a>(options_,<span class="string">'jacobian_flag'</span>,1);
|
|
0017 info = 0;
|
|
0018
|
|
0019 it_ = M_.maximum_lag + 1 ;
|
|
0020
|
|
0021 <span class="keyword">if</span> M_.exo_nbr == 0
|
|
0022 oo_.exo_steady_state = [] ;
|
|
0023 <span class="keyword">end</span>
|
|
0024
|
|
0025 <span class="comment">% check if ys is steady state</span>
|
|
0026 tempex = oo_.exo_simul;
|
|
0027 oo_.exo_simul = repmat(oo_.exo_steady_state',M_.maximum_lag+M_.maximum_lead+1,1);
|
|
0028 <span class="keyword">if</span> M_.exo_det_nbr > 0
|
|
0029 tempexdet = oo_.exo_det_simul;
|
|
0030 oo_.exo_det_simul = repmat(oo_.exo_det_steady_state',M_.maximum_lag+M_.maximum_lead+1,1);
|
|
0031 <span class="keyword">end</span>
|
|
0032 dr.ys = ys;
|
|
0033 fh = str2func([M_.fname <span class="string">'_static'</span>]);
|
|
0034 <span class="keyword">if</span> options_.linear == 0
|
|
0035 <span class="keyword">if</span> max(abs(feval(fh,dr.ys,[oo_.exo_steady_state; oo_.exo_det_steady_state]))) > options_.dynatol & options_.olr == 0
|
|
0036 <span class="keyword">if</span> exist([M_.fname <span class="string">'_steadystate'</span>])
|
|
0037 [dr.ys,check1] = feval([M_.fname <span class="string">'_steadystate'</span>],dr.ys,<span class="keyword">...</span>
|
|
0038 [oo_.exo_steady_state; oo_.exo_det_steady_state]);
|
|
0039 <span class="keyword">else</span>
|
|
0040 [dr.ys,check1] = <a href="dynare_solve.html" class="code" title="function [x,cheik] = dynare_solve(func,x,jacobian_flag,varargin)">dynare_solve</a>(fh,dr.ys,options_.jacobian_flag,<span class="keyword">...</span>
|
|
0041 [oo_.exo_steady_state; oo_.exo_det_steady_state]);
|
|
0042 <span class="keyword">end</span>
|
|
0043 <span class="keyword">if</span> check1
|
|
0044 info(1) = 20;
|
|
0045 <a href="resid.html" class="code" title="function resid(period)">resid</a> = feval(fh,ys,oo_.exo_steady_state);
|
|
0046 info(2) = <a href="resid.html" class="code" title="function resid(period)">resid</a>'*<a href="resid.html" class="code" title="function resid(period)">resid</a>; <span class="comment">% penalty...</span>
|
|
0047 <span class="keyword">return</span>
|
|
0048 <span class="keyword">end</span>
|
|
0049 <span class="keyword">end</span>
|
|
0050 <span class="keyword">else</span>
|
|
0051 [fvec,jacob] = feval(fh,dr.ys,oo_.exo_steady_state);
|
|
0052 <span class="keyword">if</span> max(abs(fvec)) > options_.dynatol & options_.olr == 0
|
|
0053 dr.ys = dr.ys-jacob\fvec;
|
|
0054 <span class="keyword">end</span>
|
|
0055 <span class="keyword">end</span>
|
|
0056
|
|
0057 dr.fbias = zeros(M_.endo_nbr,1);
|
|
0058 [dr,info] = <a href="dr1.html" class="code" title="function [dr,info]=dr1(dr,task)">dr1</a>(dr,check_flag);
|
|
0059
|
|
0060 <span class="keyword">if</span> info(1)
|
|
0061 <span class="keyword">return</span>
|
|
0062 <span class="keyword">end</span>
|
|
0063
|
|
0064 <span class="keyword">if</span> options_.dr_algo == 1 & options_.order > 1
|
|
0065 dr.ys = <a href="dynare_solve.html" class="code" title="function [x,cheik] = dynare_solve(func,x,jacobian_flag,varargin)">dynare_solve</a>(<span class="string">'dr2'</span>,ys,0,dr);
|
|
0066 dr.fbias = 2*feval([M_.fname <span class="string">'_static'</span>],dr.ys,oo_.exo_steady_state);
|
|
0067 [dr, info1] = <a href="dr1.html" class="code" title="function [dr,info]=dr1(dr,task)">dr1</a>(dr,check_flag);
|
|
0068 <span class="keyword">if</span> info1(1)
|
|
0069 info(1) = info(1)+10;
|
|
0070 <span class="keyword">return</span>
|
|
0071 <span class="keyword">end</span>
|
|
0072 <span class="keyword">end</span>
|
|
0073 <span class="keyword">if</span> M_.exo_det_nbr > 0
|
|
0074 oo_.exo_det_simul = tempexdet;
|
|
0075 <span class="keyword">end</span>
|
|
0076 oo_.exo_simul = tempex;
|
|
0077 tempex = [];
|
|
0078
|
|
0079 <span class="comment">% 01/01/2003 MJ added dr_algo == 1</span>
|
|
0080 <span class="comment">% 08/24/2001 MJ uses Schmitt-Grohe and Uribe (2001) constant correction</span>
|
|
0081 <span class="comment">% in dr.ghs2</span>
|
|
0082 <span class="comment">% 05/26/2003 MJ added temporary values for oo_.exo_simul</span></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> |