code: def test_nonstationary_series():
      # Test against R stats::ar.burg; see results/results_burg.R
      endog = np.arange(1, 12) * 1.0
      res, _ = burg(endog, 2, demean=False)
  
      desired_ar_params = [1.9669331547, -0.9892846679]
      assert_allclose(res.ar_params, desired_ar_params)
      desired_sigma2 = 0.02143066427
      assert_allclose(res.sigma2, desired_sigma2)
  
      # With var.method = 1, stats::ar.burg also returns something equivalent to
      # the innovations algorithm estimate of sigma2
      u, v = arma_innovations(endog, ar_params=res.ar_params, sigma2=1)
      desired_sigma2 = 0.02191056906
      assert_allclose(np.sum(u**2 / v) / len(u), desired_sigma2)
  
file_path: statsmodels/statsmodels/tsa/arima/estimators/tests/test_burg.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_equal, assert_raises
  from statsmodels.tsa.innovations.arma_innovations import arma_innovations
  from statsmodels.tsa.arima.datasets.brockwell_davis_2002 import dowj, lake
  from statsmodels.tsa.arima.estimators.burg import burg
label_desc: Use image node_id 5 for calling a global function with example usage: test_nonstationary_series() without return types