title: ValueError: The computed initial MA coefficients are not invertible You should induce invertibility
body: <p>I am doing a time series problem. when I am doing AR model, everything is right. </p>
  
  <pre><code># Import the module for estimating an ARMA model
  from statsmodels.tsa.arima_model import ARMA
  
  # Fit the data to an AR(p) for p = 0,...,6 , and save the BIC
  BIC = np.zeros(7)
  for p in range(7):
      mod = ARMA(data, order=(p,0))
      res = mod.fit()
  # Save BIC for AR(p)    
      BIC[p] = res.bic
  
  # Plot the BIC as a function of p
  plt.plot(range(1,7), BIC[1:7], marker='o')
  plt.xlabel('Order of AR Model')
  plt.ylabel('Bayesian Information Criterion')
  plt.show()
  </code></pre>
  
  <p>However, when I am doing MA model:</p>
  
  <pre><code># Fit the data to an MA(q) for q = 0,...,6 , and save the BIC
  BIC = np.zeros(7)
  for q in range(7):
  
      mod = ARMA(data, order=(0,q))
      res = mod.fit()
  # Save BIC for MA(q)    
      BIC[q] = res.bic
  
  
  # Plot the BIC as a function of p
  plt.plot(range(1,7), BIC[1:7], marker='o')
  plt.xlabel('Order of MA Model')
  plt.ylabel('Bayesian Information Criterion')
  plt.show()
  </code></pre>
  
  <p>I will get:</p>
  
  <pre><code>ValueError: The computed initial MA coefficients are not invertible
  You should induce invertibility, choose a different model order, or you can
  pass your own start_params.
  </code></pre>
  
  <p>After reading an answer from <a href="https://stackoverflow.com/questions/30901460/non-invertible-of-a-arima-model">non Invertible of a ARIMA model</a>, I solved the error:</p>
  
  <pre><code># Fit the data to an MA(q) for q = 0,...,6 , and save the BIC
  BIC = np.zeros(7)
  for q in range(7):
      try:
          mod = ARMA(data, order=(0,q))
          res = mod.fit()
  # Save BIC for MA(q)    
          BIC[q] = res.bic
      except:
          pass
  
  # Plot the BIC as a function of p
  plt.plot(range(1,7), BIC[1:7], marker='o')
  plt.xlabel('Order of MA Model')
  plt.ylabel('Bayesian Information Criterion')
  plt.show()
  </code></pre>
  
  <p>However, I really don't understand why it can be solved, that is why I want to ask this question. May someone give a complete answer.</p>