code: def test_innovations_mle_integrated():
      endog = np.r_[0, np.cumsum(lake.copy())]
  
      start_params = [0, np.var(lake.copy())]
      with assert_warns(UserWarning):
          p, mleres = innovations_mle(
              endog,
              order=(1, 1, 0),
              demean=False,
              start_params=start_params,
          )
  
      mod = sarimax.SARIMAX(
          endog, order=(1, 1, 0), simple_differencing=True
      )
  
      # Test that the maximized log-likelihood found via applications of the
      # innovations algorithm matches the log-likelihood found by the Kalman
      # filter at the same parameters
      res = mod.filter(p.params)
      assert_allclose(-mleres.minimize_results.fun, res.llf)
  
      # Test MLE fitting
      # To avoid small numerical differences with MLE fitting, start at the
      # parameters found from innovations_mle
      res2 = mod.fit(start_params=p.params, disp=0)
  
      # Test that the state space approach confirms the MLE values found by
      # innovations_mle
      # Note: atol is required only due to precision issues on Windows
      assert_allclose(p.params, res2.params, atol=1e-6)
  
      # Test that the result is equivalent to order=(1, 0, 0) on the differenced
      # data
      p2, _ = innovations_mle(
          lake.copy(),
          order=(1, 0, 0),
          demean=False,
          start_params=start_params,
      )
      # (does not need to be high-precision test since it's okay if different
      # starting parameters give slightly different MLE)
      assert_allclose(p.params, p2.params, atol=1e-5)
  
imports: import numpy
  import pytest
  from numpy.testing import assert_, assert_allclose, assert_warns, assert_raises
  from statsmodels.tsa.innovations.arma_innovations import arma_innovations
  from statsmodels.tsa.statespace import sarimax
  from statsmodels.tsa.arima.datasets.brockwell_davis_2002 import dowj, lake, oshorts
  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
label_desc: Use image node_id 12 for calling a global function with example usage: test_innovations_mle_integrated() without return types