code: def test_figarch_update(self):
      nobs, resids = self.nobs, self.resids
      sigma2, backcast = self.sigma2, self.backcast
      parameters = np.array([1.0, 0.2, 0.4, 0.3])
      fresids = resids**2
      p = q = 1
      trunc_lag = 1000
      rec.figarch_recursion(
          parameters,
          fresids,
          sigma2,
          p,
          q,
          nobs,
          trunc_lag,
          backcast,
          self.var_bounds,
      )
      sigma2_ref = sigma2.copy()
  
      fu = recpy.FIGARCHUpdater(p, q, 2.0, trunc_lag)
      fu.initialize_update(parameters, backcast, nobs)
      for t in range(nobs):
          fu._update_tester(
              t, parameters, resids, sigma2, self.var_bounds
          )
          if t == nobs // 2:
              fu = pickle.loads(pickle.dumps(fu))
      fu.initialize_update(parameters, backcast, nobs)
      assert_allclose(sigma2, sigma2_ref)
  
      fu = rec.FIGARCHUpdater(p, q, 2.0, trunc_lag)
      fu.initialize_update(parameters, backcast, nobs)
      for t in range(nobs):
          fu._update_tester(
              t, parameters, resids, sigma2, self.var_bounds
          )
          if t == nobs // 2:
              fu = pickle.loads(pickle.dumps(fu))
      fu.initialize_update(parameters, backcast, nobs)
      assert_allclose(sigma2, sigma2_ref)
  
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 27 for calling the TestRecursions obj's underlying member method code with example usage: obj.test_figarch_update() without return types