code: def test_first_obs(self):
      y = self.ar2_garch
      mod = arch_model(y)
      res = mod.fit(disp="off", first_obs=y.index[100])
      mod = arch_model(y[100:])
      res2 = mod.fit(disp="off")
      assert_allclose(res.params, res2.params)
      mod = arch_model(y)
      res3 = mod.fit(disp="off", first_obs=100)
      assert res.fit_start == 100
      assert_allclose(res.params, res3.params)
  
      forecast = res.forecast(horizon=3)
      assert np.all(np.asarray(np.isfinite(forecast.mean)))
      assert np.all(np.asarray(np.isfinite(forecast.variance)))
  
      forecast = res.forecast(horizon=3, start=y.index[100])
      assert np.all(np.asarray(np.isfinite(forecast.mean)))
      assert np.all(np.asarray(np.isfinite(forecast.variance)))
  
      forecast = res.forecast(horizon=3, start=100)
      assert np.all(np.asarray(np.isfinite(forecast.mean)))
      assert np.all(np.asarray(np.isfinite(forecast.variance)))
  
      with pytest.raises(ValueError):
          res.forecast(horizon=3, start=y.index[98])
  
      res = mod.fit(disp="off")
      forecast = res.forecast(horizon=3)
      assert np.all(np.asarray(np.isfinite(forecast.mean)))
      assert np.all(np.asarray(np.isfinite(forecast.variance)))
  
      forecast = res.forecast(horizon=3, start=y.index[100])
      assert np.all(np.asarray(np.isfinite(forecast.mean)))
      assert np.all(np.asarray(np.isfinite(forecast.variance)))
      forecast = res.forecast(horizon=3, start=0)
      assert np.all(np.asarray(np.isfinite(forecast.mean)))
      assert np.all(np.asarray(np.isfinite(forecast.variance)))
  
      mod = arch_model(y, mean="AR", lags=[1, 2])
      res = mod.fit(disp="off")
      with pytest.raises(ValueError):
          res.forecast(horizon=3, start=0)
  
      forecast = res.forecast(horizon=3, start=1)
      assert np.all(np.asarray(np.isfinite(forecast.mean)))
      assert np.all(np.asarray(np.isnan(forecast.variance.iloc[:1])))
      assert np.all(np.asarray(np.isfinite(forecast.variance.iloc[1:])))
  
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 16 for calling the TestForecasting obj's underlying member method code with example usage: obj.test_first_obs() without return types