n</i> : alternate long-term means, optional input</p><p><i>s</i> : matrix of computed VAR(p) parameters, [c A_1 ... A_p]</p><h2>1. Set up<a name="3"></a></h2><pre class="codeinput">N=length(Y);    <span class="comment">%number of months of historical data</span>
lagStep=[1:lag];    <span class="comment">%vector from 1 to number of lags</span>

<span class="comment">%Ensure correct dimensionality</span>
nlag=lag;
<span class="keyword">if</span> length(lag)&gt;1
  lagStep=lag;
  nlag=length(lag);
  lag=max(la