code: def test_garch_aparch_equiv(self):
      parameters = np.array([0.1, 0.1, 0.8])
      fresids = self.resids**2
      sresids = np.sign(self.resids)
      sigma2 = np.empty(1000)
      p = q = 1
      o = 0
      recpy.garch_recursion_python(
          parameters,
          fresids,
          sresids,
          sigma2,
          p,
          o,
          q,
          self.nobs,
          self.backcast,
          self.var_bounds,
      )
      sigma2_garch = sigma2.copy()
  
      parameters = np.array([0.1, 0.1, 0.8, 2])
      sigma2[:] = np.nan
      sigma2_delta = np.empty_like(sigma2)
      recpy.aparch_recursion_python(
          parameters,
          self.resids,
          np.abs(self.resids),
          sigma2,
          sigma2_delta,
          p,
          o,
          q,
          self.nobs,
          self.backcast,
          self.var_bounds,
      )
      assert_allclose(sigma2_garch, sigma2, atol=1e-6)
  
      sigma2[:] = np.nan
      recpy.aparch_recursion(
          parameters,
          self.resids,
          np.abs(self.resids),
          sigma2,
          sigma2_delta,
          p,
          o,
          q,
          self.nobs,
          self.backcast,
          self.var_bounds,
      )
      assert_allclose(sigma2_garch, sigma2, atol=1e-6)
  
      sigma2[:] = np.nan
      rec.aparch_recursion(
          parameters,
          self.resids,
          np.abs(self.resids),
          sigma2,
          sigma2_delta,
          p,
          o,
          q,
          self.nobs,
          self.backcast,
          self.var_bounds,
      )
      assert_allclose(sigma2_garch, sigma2, atol=1e-6)
  
imports: import os
  import pickle
  import timeit
  import types
  import numpy
  from numpy.random import RandomState
  from numpy.testing import assert_allclose, assert_almost_equal
  import pytest
  from scipy.special import gamma
  import arch.univariate.recursions_python
  from arch.univariate.volatility import RiskMetrics2006
label_desc: Use image node_id 24 for calling the TestRecursions obj's underlying member method code with example usage: obj.test_garch_aparch_equiv() without return types