code: def test_model_forecast():
      mod = arch_model(SP500)
      res = mod.fit(disp=False)
      res_fcast = res.forecast(horizon=10, reindex=True)
      params = np.asarray(res.params, dtype=float)
      mod_fcast = mod.forecast(params, horizon=10, reindex=True)
      new_mod = arch_model(SP500)
      new_mod_fcast = new_mod.forecast(params, horizon=10, reindex=True)
      assert_allclose(res_fcast.variance, mod_fcast.variance)
      assert_allclose(res_fcast.variance, new_mod_fcast.variance)
  
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 11 for calling a global function with example usage: test_model_forecast() without return types