ass="keyword">for</span> idx = exo
  s.B_(:,idx)=0;    <span class="comment">%other lagged variables have no effect on exogenous variable</span>
  s.B_(idx,idx)=inv(X_(:,idx)'*X_(:,idx))*X_(:,idx)'*Y_(:,idx);     <span class="comment">%exogenous variable has AR(p) process</span>
<span class="keyword">end</span>
</pre><h2>4. Set an alternate value (instead of long-term mean) for variables to center around, if applicable<a name="6"></a></h2><pre class="codeinput">simLTM=LTM;
<span class="keyword">for</span> n