code: def test_brockwell_davis_example_524_variance():
      # See `test_brockwell_davis_example_524` for the main test
      # TODO: the test for sigma2 fails, but the value reported by BD (0.02117)
      # is suspicious. For example, the Burg results have an AR coefficient of
      # 0.4371 and sigma2 = 0.1423. It seems unlikely that the small difference
      # in AR coefficient would result in an order of magniture reduction in
      # sigma2 (see test_burg::test_brockwell_davis_example_513). Should run
      # this in the ITSM program to check its output.
      endog = dowj.diff().iloc[1:]
  
      # Use Burg method to get initial coefficients for MLE
      initial, _ = burg(endog, ar_order=1, demean=True)
  
      # Fit MLE via innovations algorithm
      p, _ = innovations_mle(
          endog,
          order=(1, 0, 0),
          demean=True,
          start_params=initial.params,
      )
  
      assert_allclose(p.sigma2, 0.02117, atol=1e-4)
  
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 6 for calling a global function with example usage: test_brockwell_davis_example_524_variance() without return types