code: def test_brockwell_davis_example_515():
      # Difference and demean the series
      endog = dowj.diff().iloc[1:]
  
      # Innvations algorithm (MA)
      p, _ = innovations(endog, ma_order=17, demean=True)
  
      # First BD show the MA(2) coefficients resulting from the m=17 computations
      assert_allclose(p[17].ma_params[:2], [0.4269, 0.2704], atol=1e-4)
      assert_allclose(p[17].sigma2, 0.1122, atol=1e-4)
  
      # Then they separately show the full MA(17) coefficients
      desired = [
          0.4269,
          0.2704,
          0.1183,
          0.1589,
          0.1355,
          0.1568,
          0.1284,
          -0.0060,
          0.0148,
          -0.0017,
          0.1974,
          -0.0463,
          0.2023,
          0.1285,
          -0.0213,
          -0.2575,
          0.0760,
      ]
      assert_allclose(p[17].ma_params, desired, 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 1 for calling a global function with example usage: test_brockwell_davis_example_515() without return types