title: AR terms in SUR models - Matlab
body: <p>I am trying to estimate a SUR model of the form</p>
  
  <pre><code>y_{1,t} = \alpha_1 +\beta_1 x_{1,t} + \beta_2 x_{2,t} + \beta_3 y_{1,t-1} +\epsilon_{1,t}
  
  y_{2,t} = \alpha_2 +\beta_4 x_{1,t} + \beta_5 x_{2,t} + \beta_6 y_{2,t-1} +\epsilon_{2,t}
  </code></pre>
  
  <p>Define <code>mY = [y_1 y_2]</code> and  <code>mX = [x_1 x_2]</code>.</p>
  
  <p>For this purpose I am doing</p>
  
  <pre><code>iT = size(mY,1); iN = size(mY,2);
  mXsur = kron(mX, eye(iN));
  mXsurCell = mat2cell(mXsur, iN*ones(iT,1));
  iR = size(mXsur,2);
  Mdl = vgxset('n', iN, 'nAR',1, 'nX',iR,'Constant',true);
  [SurOutput, SurSDerror, ~,SURcov] = vgxvarx(Mdl, mY, mXsurCell);
  </code></pre>
  
  <p>The issue is that the bit of code <code>nAR</code>, 1 seems to add 1 lag of both <code>y</code> variables to each equation and I only wish to add one per equation. Is there a quick way to do this?</p>
  
  <p>(Of course I can include the lagged terms manually in the <code>mX</code> matrix, but my question is whether we can do this via <code>vgxset</code> in a quicker way. I think not based on my reading of the help file, but still want to double check). Thanks</p>