title: How to get out-of-sample forecasts from predict function
body: <p>I'm using the <code>vars</code> package and want to predict some values from the calculated models:</p>
  
  <pre><code># Get the model
  x1 &lt;- rnorm(15)
  y1 &lt;- x1 + rnorm(15)
  trainFrame=data.frame(x1,y1);
  model=VAR(trainFrame, p=3);
  pr1=predict(model, trainFrame);
  # Forecast values with new data
  x2 &lt;- rnorm(15)
  y2 &lt;- x2 + rnorm(15)
  newFrame=data.frame(x2,y2);
  pr2=predict(model, newFrame);
  </code></pre>
  
  <p>Comparing the two prediction vectors <code>pr1</code> and <code>pr2</code> shows that they are the same.
  How can I get the actual forecast values and not again the forecasts from the training data?</p>