title: ARIMA modelling, prediction and plotting with CO2 dataset in R
body: <p>I am working with <code>arima0()</code> and <code>co2</code>. I would like to plot <code>arima0()</code> model over my data. I have tried <code>fitted()</code> and <code>curve()</code> with no success.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>###### Time Series
  
  # format: time series
  data(co2)
  
  # format: matrix
  dmn &lt;- list(month.abb, unique(floor(time(co2))))
  co2.m &lt;- matrix(co2, 12, dimnames = dmn)
  
  co2.dt &lt;- pracma::detrend(co2.m, tt = 'linear')
  co2.dt &lt;- ts(as.numeric(co2.dt), start = c(1959,1), frequency=12)
  
  # first diff
  co2.dt.dif &lt;- diff(co2.dt,lag = 12)
  
  # Second diff
  co2.dt.dif2 &lt;- diff(co2.dt.dif,lag = 1)
  </code></pre>
  
  <p>With the data prepared, I ran the following <code>arima0</code>:</p>
  
  <pre><code>results &lt;- arima0(co2.dt.dif2, order = c(2,0,0), method = "ML")
  resultspredict &lt;- predict(results, n.ahead = 36)
  </code></pre>
  
  <p>I would like to plot the model and the prediction. I am hoping there is a way to do this in base R. I would also like to be able to plot the predictions as well.</p>