lass="keyword">end</span>
      Zhat(i,:,p)=(H*X)';   <span class="comment">%forecasted rates (1-year forward)</span>
      T(i,:,p)=F(i,:,p)-Zhat(i,:,p);    <span class="comment">% term premia estimate (model), not used</span>
      T1(i,:,p)=F(i,:,p)-Zb(i,:,p); <span class="comment">% term-premia estimate (random walk)</span>
    <span class="keyword">end</span>
  <span class="keyword">end</span>
</pre><h2>3. Compute term premia for VAR(2) model<a name="6"></a></h2><pre class="codeinput"><span class="keyw