code: def setup_class(cls):
      cls.rng = RandomState(12345)
      am = arch_model(None, mean="Constant", vol="Constant")
      data = am.simulate(np.array([0.0, 10.0]), 1000)
      data.index = pd.date_range(
          "2000-01-01", periods=data.index.shape[0]
      )
      cls.zero_mean = data.data
  
      am = arch_model(None, mean="AR", vol="Constant", lags=[1])
      data = am.simulate(np.array([1.0, 0.9, 2]), 1000)
      data.index = pd.date_range(
          "2000-01-01", periods=data.index.shape[0]
      )
      cls.ar1 = data.data
  
      am = arch_model(None, mean="AR", vol="Constant", lags=[1, 2])
      data = am.simulate(np.array([1.0, 1.9, -0.95, 2]), 1000)
      data.index = pd.date_range(
          "2000-01-01", periods=data.index.shape[0]
      )
      cls.ar2 = data.data
  
      am = arch_model(None, mean="HAR", vol="Constant", lags=[1, 5, 22])
      data = am.simulate(np.array([1.0, 0.4, 0.3, 0.2, 2]), 1000)
      data.index = pd.date_range(
          "2000-01-01", periods=data.index.shape[0]
      )
      cls.har3 = data.data
  
      am = arch_model(
          None, mean="AR", vol="GARCH", lags=[1, 2], p=1, q=1
      )
      data = am.simulate(
          np.array([1.0, 1.9, -0.95, 0.05, 0.1, 0.88]), 1000
      )
      data.index = pd.date_range(
          "2000-01-01", periods=data.index.shape[0]
      )
      cls.ar2_garch = data.data
  
imports: import datetime
  from itertools import product
  import numpy
  from numpy.random import RandomState
  from numpy.testing import assert_allclose
  import pandas
  from pandas.testing import assert_frame_equal
  import pytest
  from arch.data import sp500
  from arch.tests.univariate.test_variance_forecasting import preserved_state
  from arch.univariate import APARCH, ARX, EGARCH, FIGARCH, GARCH, HARCH, HARX, ConstantMean, ConstantVariance, EWMAVariance, MIDASHyperbolic, RiskMetrics2006, ZeroMean, arch_model
  from arch.univariate.mean import _ar_forecast, _ar_to_impulse
label_desc: Use image node_id 1 for calling the TestForecasting obj's underlying member method code with example usage: obj.setup_class(cls) without return types