title: Computing RSS of ARIMA model
body: <p>I created an AR model whose parameters were based on my analysis of the data's autocorellation and partial autocorellation function. There is an error however when i try to compute the RSS value of the resulting model. Here is the code I used:</p>
  
  <pre><code>import matplotlib.pylab as plt
  from matplotlib.pylab import rcParams
  rcParams['figure.figsize'] = 15, 6
  import pandas as pd
  from statsmodels.tsa.arima_model import ARIMA
  
  df = pd.read_csv('data.csv', header=0, index_col=0, parse_dates=True, sep=';')
  model = ARIMA(df, order=(6, 0, 0))
  results_ARIMA = model.fit(disp=-1)  
  plt.plot(df, color='blue', label='Original')
  plt.plot(results_ARIMA.fittedvalues, color='red', label='Predicted')
  plt.plot(results_ARIMA.predict(start = 23, end = 34, dynamic=True), color='red')
  plt.title('RSS: %.4f'% sum((results_ARIMA.fittedvalues-df)**2))
  </code></pre>
  
  <p>Which results in this error message:</p>
  
  <p>File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
      execfile(filename, namespace)</p>
  
  <p>File "C:\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
      exec(compile(f.read(), filename, 'exec'), namespace)</p>
  
  <p>File "C:/Users/Patrick Ulanday/Desktop/Thesis/ARIMA/CRWFR_boundary_ARIMA/ARIMA.py", line 64, in 
      print ('RSS: %.4f'% sum((results_ARIMA.fittedvalues-df)**2))</p>
  
  <p>File "pandas/_libs/tslib.pyx", line 787, in pandas._libs.tslib.Timestamp.<strong>radd</strong></p>
  
  <p>File "pandas/_libs/tslib.pyx", line 1275, in pandas._libs.tslib._Timestamp.<strong>add</strong></p>
  
  <p>ValueError: Cannot add integral value to Timestamp without freq.</p>
  
  <p>The modelling actually worked and is plotted but i can't upload the image, the problem is with the computation of the RSS.</p>