 class="keyword">elseif</span> j==2;
	  X(:,j)=para.B(:,1) + para.B(:,2:K+1)*X(:,j-1) <span class="keyword">...</span>
		 + para.B(:,K+2:2*K+1)*data.X(i,:,p)';
	<span class="keyword">else</span>
	  X(:,j)=para.B(:,1) + para.B(:,2:K+1)*X(:,j-1) <span class="keyword">...</span>
		 + para.B(:,K+2:2*K+1)*X(:,j-2);
	<span class="keyword">end</span>
      <span class="keyword">end</span>
      Zhat(i,:,p)=(H*X(:,end))';
      T(i,:,p)=F(i,:,p)-Zhat(i,:,p);    <span class="comment">% term premia estimate (model)</