code: def test_forecast_start_alternatives(self):
      am = arch_model(
          self.har3, mean="HAR", vol="Constant", lags=[1, 5, 22]
      )
      res = am.fit()
      date = self.har3.index[21]
      fcast_1 = res.forecast(start=21)
      fcast_2 = res.forecast(start=date)
      for field in ("mean", "variance", "residual_variance"):
          assert_frame_equal(
              getattr(fcast_1, field), getattr(fcast_2, field)
          )
      pydt = dt.datetime(date.year, date.month, date.day)
      fcast_2 = res.forecast(start=pydt)
      for field in ("mean", "variance", "residual_variance"):
          assert_frame_equal(
              getattr(fcast_1, field), getattr(fcast_2, field)
          )
  
      strdt = pydt.strftime("%Y-%m-%d")
      fcast_2 = res.forecast(start=strdt)
      for field in ("mean", "variance", "residual_variance"):
          assert_frame_equal(
              getattr(fcast_1, field), getattr(fcast_2, field)
          )
  
      npydt = np.datetime64(pydt).astype("M8[ns]")
      fcast_2 = res.forecast(start=npydt)
      for field in ("mean", "variance", "residual_variance"):
          assert_frame_equal(
              getattr(fcast_1, field), getattr(fcast_2, field)
          )
  
      with pytest.raises(ValueError):
          date = self.har3.index[20]
          res.forecast(start=date)
  
      with pytest.raises(ValueError):
          date = self.har3.index[0]
          res.forecast(start=date)
  
      fcast_0 = res.forecast()
      fcast_1 = res.forecast(start=999)
      fcast_2 = res.forecast(start=self.har3.index[999])
      for field in ("mean", "variance", "residual_variance"):
          assert_frame_equal(
              getattr(fcast_0, field), getattr(fcast_1, field)
          )
  
          assert_frame_equal(
              getattr(fcast_0, field), getattr(fcast_2, field)
          )
  
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 10 for calling the TestForecasting obj's underlying member method code with example usage: obj.test_forecast_start_alternatives() without return types