code: def test_invalid():
      # Tests that invalid options raise errors
      # (note that this is only invalid options specific to `ARIMA`, and not
      # invalid options that would raise errors in SARIMAXSpecification).
      endog = dta["infl"].iloc[:50]
      mod = ARIMA(endog, order=(1, 0, 0))
  
      # Need valid method
      assert_raises(ValueError, mod.fit, method="not_a_method")
  
      # Can only use certain methods with fixed parameters
      # (e.g. 'statespace' and 'hannan-rissanen')
      with mod.fix_params({"ar.L1": 0.5}):
          assert_raises(ValueError, mod.fit, method="yule_walker")
  
      # Cannot override model-level values in fit
      assert_raises(
          ValueError,
          mod.fit,
          method="statespace",
          method_kwargs={"enforce_stationarity": False},
      )
  
      # start_params only valid for MLE methods
      assert_raises(
          ValueError,
          mod.fit,
          method="yule_walker",
          start_params=[0.5, 1.0],
      )
  
      # has_exog and gls=False with non-statespace method
      mod2 = ARIMA(endog, order=(1, 0, 0), trend="c")
      assert_raises(
          ValueError, mod2.fit, method="yule_walker", gls=False
      )
  
      # non-stationary parameters
      mod3 = ARIMA(np.arange(100) * 1.0, order=(1, 0, 0), trend="n")
      assert_raises(ValueError, mod3.fit, method="hannan_rissanen")
  
      # non-invertible parameters
      mod3 = ARIMA(np.arange(20) * 1.0, order=(0, 0, 1), trend="n")
      assert_raises(ValueError, mod3.fit, method="hannan_rissanen")
  
imports: from statsmodels.compat.platform import PLATFORM_WIN32
  import io
  import numpy
  import pandas
  import pytest
  from numpy.testing import assert_equal, assert_allclose, assert_raises, assert_
  from statsmodels.datasets import macrodata
  from statsmodels.tsa.arima.model import ARIMA
  from statsmodels.tsa.arima.estimators.yule_walker import yule_walker
  from statsmodels.tsa.arima.estimators.burg import burg
  from statsmodels.tsa.arima.estimators.hannan_rissanen import hannan_rissanen
  from statsmodels.tsa.arima.estimators.innovations import innovations, innovations_mle
  from statsmodels.tsa.arima.estimators.statespace import statespace
label_desc: Use image node_id 2 for calling a global function with example usage: test_invalid() without return types