title: Forecasting with SARIMAX, unexpected results
body: <p>I'm trying to forecast with 36 steps with a SARIMAX model. First I remove heterocedasticity via sqrt and trend via a linear model. Fitted values of the model are similar to the series, but when i try to forecast the results are a bit off. I don't know if i messed up some parameter or something. Here is my code:<a href="https://i.stack.imgur.com/UaXKG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UaXKG.png" alt="enter image description here" /></a></p>
  <pre><code>#remove heterocedasticity
  datos_sqrt=np.sqrt(train)
  #remove trend
  X = np.array(range(0,len(datos_sqrt)))
  X = np.reshape(X, (len(X), 1))
  y = datos_sqrt.values
  model = LinearRegression()
  model.fit(X, datos_sqrt)
  trend = model.predict(X)
  train_sqrt_trend = datos_sqrt-trend
  #fit model
  model = SARIMAX(train_sqrt_trend,order = (1, 2, 0),seasonal_order = (2,2,0,12),
                  enforce_stationarity=False,
                  enforce_invertibility=False)
  results = model.fit()
  fitted_values = pd.DataFrame(results.fittedvalues)
  #forecast
  forecast = results.forecast(steps = 36)
  fig, ax = plt.subplots(1, 1, figsize=(15, 5))
  plt.plot(fitted_values,label='Fitted')
  plt.plot(forecast,label='forecast')
  plt.legend(loc='best')
  </code></pre>