code: def test_rescale():
      # GH 632
  
      rets = 100 * SP500.copy()
  
      model = arch_model(
          rets,
          p=1,
          o=0,
          q=1,
          mean="AR",
          lags=1,
          vol="GARCH",
          dist="normal",
          rescale=False,
      )
      res = model.fit(disp="off")
  
      model_rescale = arch_model(
          rets,
          p=1,
          o=0,
          q=1,
          mean="AR",
          lags=1,
          vol="GARCH",
          dist="normal",
          rescale=True,
      )
      res_rescale = model_rescale.fit(disp="off")
  
      lr_fcast = res.forecast(horizon=10000)
      lr_fcast_rescale = res_rescale.forecast(horizon=10000)
  
      omega_bar = res.params.omega / (
          1 - res.params["alpha[1]"] - res.params["beta[1]"]
      )
      assert_allclose(
          lr_fcast.residual_variance.iloc[0, -1], omega_bar, rtol=1e-5
      )
  
      omega_bar_rescale = res_rescale.params.omega / (
          1
          - res_rescale.params["alpha[1]"]
          - res_rescale.params["beta[1]"]
      )
      assert_allclose(
          lr_fcast_rescale.residual_variance.iloc[0, -1],
          omega_bar_rescale,
          rtol=1e-5,
      )
  
      rets = 10000 * SP500.copy()
      model_rescale = arch_model(
          rets,
          p=1,
          o=0,
          q=1,
          mean="AR",
          lags=1,
          vol="GARCH",
          dist="normal",
          rescale=True,
      )
      res_rescale = model_rescale.fit(disp="off")
      omega_bar_rescale = res_rescale.params.omega / (
          1
          - res_rescale.params["alpha[1]"]
          - res_rescale.params["beta[1]"]
      )
      assert_allclose(
          lr_fcast_rescale.residual_variance.iloc[0, -1],
          omega_bar_rescale,
          rtol=1e-5,
      )
  
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 15 for calling a global function with example usage: test_rescale() without return types