ord">elseif</span> get(ns,<span class="string">'lags'</span>)==2

  <span class="keyword">for</span> p=1:M;
    <span class="keyword">for</span> i=1:N
      Zb(i,:,p)=interp1(simTenor,data.Z(i,:,p)',ttm,<span class="string">'spline'</span>);
      F(i,:,p)=forward(Zb(i,:,p),ttm);
      X=[];
      <span class="keyword">for</span> j=1:12
	<span class="keyword">if</span> j==1;
	  X(:,j)=para.B(:,1) + para.B(:,2:K+1)*data.X(i,:,p)' <span class="keyword">...</span>
		 + para.B(:,K+2:2*K+1)*para.X(:,end);
	<span