code: def test_bounds(self):
      nobs, resids = self.nobs, self.resids
      sigma2, backcast = self.sigma2, self.backcast
  
      parameters = np.array([1e100, 0.4, 0.3, 0.2])
      lags = np.array([1, 5, 22], dtype=np.int32)
      recpy.harch_recursion(
          parameters,
          resids,
          sigma2,
          lags,
          nobs,
          backcast,
          self.var_bounds,
      )
      sigma2_python = sigma2.copy()
      rec.harch_recursion(
          parameters,
          resids,
          sigma2,
          lags,
          nobs,
          backcast,
          self.var_bounds,
      )
      assert_almost_equal(sigma2_python, sigma2)
      assert np.all(sigma2 >= self.var_bounds[:, 0])
      assert np.all(sigma2 <= 1.1 * self.var_bounds[:, 1])
  
      parameters = np.array([-1e100, 0.4, 0.3, 0.2])
      recpy.harch_recursion(
          parameters,
          resids,
          sigma2,
          lags,
          nobs,
          backcast,
          self.var_bounds,
      )
      sigma2_python = sigma2.copy()
      rec.harch_recursion(
          parameters,
          resids,
          sigma2,
          lags,
          nobs,
          backcast,
          self.var_bounds,
      )
      assert_almost_equal(sigma2_python, sigma2)
      assert_almost_equal(sigma2, self.var_bounds[:, 0])
  
      parameters = np.array([1e100, 0.4, 0.3, 0.2])
      fresids = resids**2.0
      sresids = np.sign(resids)
  
      recpy.garch_recursion(
          parameters,
          fresids,
          sresids,
          sigma2,
          1,
          1,
          1,
          nobs,
          backcast,
          self.var_bounds,
      )
      sigma2_python = sigma2.copy()
      rec.garch_recursion(
          parameters,
          fresids,
          sresids,
          sigma2,
          1,
          1,
          1,
          nobs,
          backcast,
          self.var_bounds,
      )
      assert_almost_equal(sigma2_python, sigma2)
      assert np.all(sigma2 >= self.var_bounds[:, 0])
      assert np.all(sigma2 <= 1.1 * self.var_bounds[:, 1])
  
      parameters = np.array([-1e100, 0.4, 0.3, 0.2])
      recpy.garch_recursion(
          parameters,
          fresids,
          sresids,
          sigma2,
          1,
          1,
          1,
          nobs,
          backcast,
          self.var_bounds,
      )
      sigma2_python = sigma2.copy()
      rec.garch_recursion(
          parameters,
          fresids,
          sresids,
          sigma2,
          1,
          1,
          1,
          nobs,
          backcast,
          self.var_bounds,
      )
      assert_almost_equal(sigma2_python, sigma2)
      assert_almost_equal(sigma2, self.var_bounds[:, 0])
  
      parameters = np.array([1e100, 0.4, 0.3, 0.2])
      recpy.arch_recursion(
          parameters, resids, sigma2, 3, nobs, backcast, self.var_bounds
      )
      sigma2_python = sigma2.copy()
      rec.arch_recursion(
          parameters, resids, sigma2, 3, nobs, backcast, self.var_bounds
      )
      assert_almost_equal(sigma2_python, sigma2)
      assert np.all(sigma2 >= self.var_bounds[:, 0])
      assert np.all(sigma2 <= 1.1 * self.var_bounds[:, 1])
  
      parameters = np.array([-1e100, 0.4, 0.3, 0.2])
      recpy.arch_recursion(
          parameters, resids, sigma2, 3, nobs, backcast, self.var_bounds
      )
      sigma2_python = sigma2.copy()
      rec.arch_recursion(
          parameters, resids, sigma2, 3, nobs, backcast, self.var_bounds
      )
      assert_almost_equal(sigma2_python, sigma2)
      assert_almost_equal(sigma2, self.var_bounds[:, 0])
  
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 13 for calling the TestRecursions obj's underlying member method code with example usage: obj.test_bounds() without return types