title: Innovations algorithm in Matlab
body: <p>This seems like it's supposed to be a simple task but going through the "predict" documentation in Matlab I found this to look unnecessarily complicated so I could be looking in the wrong direction.</p>
  
  <p>Suppose I have 'data':</p>
  
  <p>$X_{1},\ldots,X_{10}$={4.5368, 5.8243, 5.4501, 5.6528, 4.3195, 4.0114, 2.4993, 2.2201, 1.3771, 0.7707}.</p>
  
  <p>I believe I could fit this data using an ARMA(p,q) (or ARIMA(p,d,q)) model. For instance, I want to fit an ARMA(2,3) model to this data, i.e. </p>
  
  <p>$X_{t}-\phi_{1}X_{t-1}-\phi X_{t-2}=Z_{t}+\theta_{1}Z_{t-1}+\theta_{2}Z_{t-2}+\theta_{3}Z_{t-3}$, where $Z_{t}\sim WN(0,1)$.</p>
  
  <p>I could go through the innovations algorithm by hand to do this but for large data sets this becomes impossible. Is there a way to do this in Matlab? In particular, <strong>I want to check the predictors $\hat{X}_{4},\ldots,\hat{X}_{10}$. (And possibly other values in the calculation process.)</strong> How does this work using "predict" (or some other function)? </p>
  
  <p>I tried using "estimate":</p>
  
  <pre><code>[EstMdl,EstParamCov,logL,info] = estimate(arima('ARLags',1:2,'D',0,'MALags',1:3,'Constant',0),data);
  </code></pre>
  
  <p>and then predict three values:</p>
  
  <pre><code>predict(EstMdl,data,3)
  </code></pre>
  
  <p>but apparently Matlab does not take 'EstMdl' as a valid model here (although 'EstMdl' works when forecasting $X_{11}, X_{12},\ldots $ using the function "forecast": [y,ymse]=forecast(EstMdl,3,'Y0',data);). </p>
  
  <p>I'll need to resort to "idpoly", "armax" or "idss" instead to define the model? How to do this?</p>
  
  <p>Btw: I generated the 'data' in R using $\phi_{1}=1, \phi_{2}=-0.24, \theta_{1}=0.4, \theta_{2}=0.2, \theta_{3}=0.1$. </p>
  
  <pre><code>data&lt;-arima.sim(n = 10, list(ar = c(1,-0.24), ma = c(0.4,0.2,0.1)),sd = sqrt(1))
  </code></pre>
  
  <p>A solution in R is also welcome.</p>