code: def test_egarch_100(setup):
      egarch = EGARCH(p=1, o=0, q=0)
  
      sv = egarch.starting_values(setup.resids)
      assert_equal(sv.shape[0], egarch.num_params)
  
      backcast = egarch.backcast(setup.resids)
      w = 0.94 ** np.arange(75)
      backcast_test = np.sum((setup.resids[:75] ** 2) * (w / w.sum()))
      assert_almost_equal(backcast, np.log(backcast_test))
  
      var_bounds = egarch.variance_bounds(setup.resids)
      parameters = np.array([0.1, 0.4])
      egarch.compute_variance(
          parameters, setup.resids, setup.sigma2, backcast, var_bounds
      )
      cond_var_direct = np.zeros_like(setup.sigma2)
      lnsigma2 = np.empty(setup.t)
      std_resids = np.empty(setup.t)
      abs_std_resids = np.empty(setup.t)
      rec.egarch_recursion(
          parameters,
          setup.resids,
          cond_var_direct,
          1,
          0,
          0,
          setup.t,
          backcast,
          var_bounds,
          lnsigma2,
          std_resids,
          abs_std_resids,
      )
      assert_allclose(setup.sigma2, cond_var_direct)
  
      state = setup.rng.get_state()
      rng = Normal(seed=RandomState())
      rng.generator.set_state(state)
      sim_data = egarch.simulate(parameters, setup.t, rng.simulate([]))
      setup.rng.set_state(state)
      e = setup.rng.standard_normal(setup.t + 500)
      initial_value = 0.1 / (1 - 0.95)
      lnsigma2 = np.zeros(setup.t + 500)
      lnsigma2[0] = initial_value
      sigma2 = np.zeros(setup.t + 500)
      sigma2[0] = np.exp(lnsigma2[0])
      data = np.zeros(setup.t + 500)
      data[0] = np.sqrt(sigma2[0]) * e[0]
      norm_const = np.sqrt(2 / np.pi)
      for t in range(1, setup.t + 500):
          lnsigma2[t] = parameters[0]
          lnsigma2[t] += parameters[1] * (np.abs(e[t - 1]) - norm_const)
  
      sigma2 = np.exp(lnsigma2)
      data = e * np.sqrt(sigma2)
  
      data = data[500:]
      sigma2 = sigma2[500:]
  
      assert_almost_equal(data - sim_data[0] + 1.0, np.ones_like(data))
      assert_almost_equal(sigma2 / sim_data[1], np.ones_like(sigma2))
  
imports: import types
  from typing import NamedTuple
  import warnings
  import numpy
  from numpy.random import RandomState
  from numpy.testing import assert_allclose, assert_almost_equal, assert_array_equal, assert_equal
  import pytest
  from scipy.special import gamma, gammaln
  from arch.univariate import ZeroMean
  from arch.univariate.distribution import Normal, SkewStudent, StudentsT
  import arch.univariate.recursions_python
  from arch.univariate.volatility import APARCH, ARCH, EGARCH, FIGARCH, GARCH, HARCH, ConstantVariance, EWMAVariance, FixedVariance, MIDASHyperbolic, RiskMetrics2006
  from arch.utility.exceptions import InitialValueWarning
label_desc: Use image node_id 22 for calling a global function with example usage: test_egarch_100(setup) without return types