code: def test_fixed_variance(self):
      parameters = np.array([1.0])
      resids = self.resid
      variance = np.arange(resids.shape[0]) + 1.0
      vol = FixedVariance(variance)
      vol.start = 0
      vol.stop = 1000
      backcast = vol.backcast(resids)
      var_bounds = vol.variance_bounds(resids)
      forecasts = vol.forecast(
          parameters, resids, backcast, var_bounds, horizon=1
      )
      assert np.all(np.isnan(forecasts.forecasts))
      assert forecasts.forecast_paths is None
      assert forecasts.shocks is None
  
      forecasts = vol.forecast(
          parameters, resids, backcast, var_bounds, horizon=7
      )
      assert np.all(np.isnan(forecasts.forecasts))
      assert forecasts.forecast_paths is None
      assert forecasts.shocks is None
  
      dist = Normal(seed=self.rng)
      rng = dist.simulate([])
      forecasts = vol.forecast(
          parameters,
          resids,
          backcast,
          var_bounds,
          333,
          horizon=4,
          method="simulation",
          simulations=100,
          rng=rng,
      )
      assert np.all(np.isnan(forecasts.forecasts))
      assert np.all(np.isnan(forecasts.forecast_paths))
      assert np.all(np.isnan(forecasts.shocks))
  
      forecasts = vol.forecast(
          parameters,
          resids,
          backcast,
          var_bounds,
          100,
          2,
          "bootstrap",
          500,
      )
      assert np.all(np.isnan(forecasts.forecasts))
      assert np.all(np.isnan(forecasts.forecast_paths))
      assert np.all(np.isnan(forecasts.shocks))
  
imports: import numpy
  from numpy.random import RandomState
  from numpy.testing import assert_allclose
  import pandas
  import pytest
  from arch.univariate import arch_model
  from arch.univariate.distribution import Normal, StudentsT
  from arch.univariate.mean import ConstantMean
  from arch.univariate.volatility import APARCH, EGARCH, FIGARCH, GARCH, HARCH, BootstrapRng, ConstantVariance, EWMAVariance, FixedVariance, MIDASHyperbolic, RiskMetrics2006
label_desc: Use image node_id 42 for calling the TestVarianceForecasts obj's underlying member method code with example usage: obj.test_fixed_variance() without return types