80 lines
4.3 KiB
HTML
80 lines
4.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 kalman_transition_matrix</title>
|
|
<meta name="keywords" content="kalman_transition_matrix">
|
|
<meta name="description" content="makes transition matrices out of ghx and ghu for Kalman filter">
|
|
<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> > kalman_transition_matrix.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>kalman_transition_matrix
|
|
</h1>
|
|
|
|
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
|
<div class="box"><strong>makes transition matrices out of ghx and ghu for Kalman filter</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 [A,B] = kalman_transition_matrix(dr) </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"> makes transition matrices out of ghx and ghu for Kalman filter
|
|
still needs to eliminate unobserved static variables
|
|
order of variables s p b f p_1</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)">
|
|
<li><a href="UnivariateSpectralDensity.html" class="code" title="function [omega,f] = UnivariateSpectralDensity(dr,var_list)">UnivariateSpectralDensity</a> stephane.adjemian@ens.fr</li><li><a href="dynare_resolve.html" class="code" title="function [A,B,ys,info] = dynare_resolve()">dynare_resolve</a> </li><li><a href="th_autocovariances.html" class="code" title="function [Gamma_y,ivar]=th_autocovariances(dr,ivar)">th_autocovariances</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">% makes transition matrices out of ghx and ghu for Kalman filter</span>
|
|
0002 <span class="comment">% still needs to eliminate unobserved static variables</span>
|
|
0003 <span class="comment">% order of variables s p b f p_1</span>
|
|
0004
|
|
0005 <a name="_sub0" href="#_subfunctions" class="code">function [A,B] = kalman_transition_matrix(dr)</a>
|
|
0006 <span class="keyword">global</span> M_
|
|
0007 nx = size(dr.ghx,2)+dr.nfwrd+dr.nstatic;
|
|
0008 kstate = dr.kstate;
|
|
0009 ikx = [dr.nstatic+1:dr.nstatic+dr.npred];
|
|
0010
|
|
0011 A = zeros(nx,nx);
|
|
0012 k0 = kstate(find(kstate(:,2) <= M_.maximum_lag+1),:);
|
|
0013 i0 = find(k0(:,2) == M_.maximum_lag+1);
|
|
0014 n0 = size(dr.ghx,1);
|
|
0015 A(1:n0,dr.nstatic+1:dr.nstatic+dr.npred) = dr.ghx(:,1:dr.npred);
|
|
0016 A(1:n0,dr.nstatic+dr.npred+dr.nfwrd+1:end) = dr.ghx(:,dr.npred+1:end);
|
|
0017 B = zeros(nx,M_.exo_nbr);
|
|
0018 B(1:n0,:) = dr.ghu;
|
|
0019 offset_col = dr.nstatic;
|
|
0020 <span class="keyword">for</span> i=M_.maximum_lag:-1:2
|
|
0021 i1 = find(k0(:,2) == i);
|
|
0022 n1 = size(i1,1);
|
|
0023 j = zeros(n1,1);
|
|
0024 <span class="keyword">for</span> j1 = 1:n1
|
|
0025 j(j1) = find(k0(i0,1)==k0(i1(j1),1));
|
|
0026 <span class="keyword">end</span>
|
|
0027 <span class="keyword">if</span> i == M_.maximum_lag-1
|
|
0028 offset_col = dr.nstatic+dr.nfwrd;
|
|
0029 <span class="keyword">end</span>
|
|
0030 A(n0+i1-dr.npred,offset_col+i0(j))=eye(n1);
|
|
0031 i0 = i1;
|
|
0032 <span class="keyword">end</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> |