title: How to run this simple VAR (VARX?) model in matlab, using vgxvarx?
body: <p>Basically, I want to run a VAR model (bivariate) with a linear time trend, and a constant. That is, I was to estimate an equation of the form (pardon the poor notation, but no mathjax here I believe, and I feel equations are easier than words)</p>
  
  <pre><code>    [x_t y_t]'= [c_1 c_2]' + [p_1^1 p_2^1 ; p_1^2 p_2^2]* [x_{t-1} y_{t-1}]' +
        + [g^x g^y]'*t + [e^x e^y]
  </code></pre>
  
  <p>where the <code>e</code>'s are error terms (white noise), the <code>g</code>'s are "gammas", that is constants on the time trend, the <code>c</code>'s are constant, and the <code>{t-1}</code> terms are lagged, and the matrix they are multiplied by are coefficients on the lags.</p>
  
  <p>My problem, or at least what I cannot seem to figure out, is how to implement the <code>[g^x g^y]'*t</code> term. This is because, if I specify <code>t</code> as part of the time series, the vgxvarx, then a lag term for <code>t</code> will be included, which is not what I want. However, <strong>if I include <code>t</code> as exogenous data, then matlab gives me a (1x1) matrix of coefficients, <code>b</code>. However, I am looking for a (2x1) vector of coefficients</strong>...</p>
  
  <p>That is, matlab seems to implement the exogenous data as <code>X_t * b</code> where <code>X_t</code> is (n x r) and <code>b</code> is a vector of regression coefficients of size <code>r</code>.</p>
  
  <p>I realize that I can estimate this equation using <code>mvregress</code>, which I have done. However, I am curious about whether it is possible to estimate the equation using vgxvarx?</p>
  
  <p>Thank you.</p>
  
  <p>Edit: To perhaps slightly elaborate on my issue: the specification I wish to estimate has <code>[g^x g^y]'*t</code>, where <code>g^x</code> <code>g^y</code> are coefficients I need to be estimate, and <code>y</code>, which is just the current time period, is an input (a regressor). Matlab, however, when given exogenous data for vgxvarx, estimates <code>X_t *b</code>, which is giving me trouble (I need to have <code>X_t</code> have at least two dimensions, for one thing, but <code>t</code> is one dimensional in the specification. Even if I say okay, let <code>X_t</code> be two-dimensional, the <code>b</code> is one dimensional, when I want a (2 x 1) vector of coefficients...)</p>
  
  <p>Edit2: Some helpful links:</p>
  
  <p><a href="http://www.mathworks.com/help/econ/introduction-to-vector-autoregressive-var-models.html" rel="nofollow">Matlab page on VAR models</a>
  <a href="http://cn.mathworks.com/help/pdf_doc/econ/econ.pdf" rel="nofollow">Econometrics toolbox pdf.</a> 3-37 has an example I find somewhat similar. I will put some of the relevant code below:</p>
  
  <pre><code>        tcell = cell(1000,1); % Time as exogenous input
          for i=1:1000
                tcell{i} = [i;0];
          end
  </code></pre>
  
  <p>As the snippet of code shows, they are included "Time as exogenous input", but again it is 2-dimensional, which is not what I want.</p>
  
  <p>Edit 3: <strong>I have not tried re-working the equation</strong> to try and write it without the <code>*t</code> term. Perhaps that is the solution. If so, I don't need the math worked out, but please let me know if that is the only (or only viable way) to estimate the equation using vgxvarx</p>