n are redefined in terms of difference from long-term mean, with no constant vector, so that VAR is stationary around LTM</p><pre class="codeinput">X = [ones(N-lag,1)];
X_= [];
<span class="keyword">for</span> tt=lagStep
  X = [X  Y(lag-tt+1:end-tt,:)];    <span class="comment">%matrix of lagged combined time series for lags 1,...,p (with constant vector)</span>
  X_= [X_ Y(lag-tt+1:end-tt,:)-LTM(ones(N-lag,1),:)];   <span class="comment">%matrix in terms of difference from long-term mean, no constant vecto