code: def check_innovations_ma_itsmr(lake):
      # Test against R itsmr::ia; see results/results_innovations.R
      ia, _ = innovations(lake, 10, demean=True)
  
      desired = [
          1.0816255264,
          0.7781248438,
          0.5367164430,
          0.3291559246,
          0.3160039850,
          0.2513754550,
          0.2051536531,
          0.1441070313,
          0.3431868340,
          0.1827400798,
      ]
      assert_allclose(ia[10].ma_params, desired)
  
      # itsmr::ia returns the innovations algorithm estimate of the variance
      u, v = arma_innovations(
          np.array(lake) - np.mean(lake),
          ma_params=ia[10].ma_params,
          sigma2=1,
      )
      desired_sigma2 = 0.4523684344
      assert_allclose(np.sum(u**2 / v) / len(u), desired_sigma2)
  
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 2 for calling a global function with example usage: check_innovations_ma_itsmr(lake) without return types