code: def test_pandas_anchor():
      # Test that anchor with dates works
      ix = pd.date_range(start="2000", periods=2, freq=MONTH_END)
      endog = pd.Series(np.zeros(2), index=ix)
      mod = sarimax.SARIMAX(endog)
      res = mod.filter([0.5, 1.0])
  
      desired = res.simulate(
          2,
          anchor=1,
          state_shocks=np.zeros(2),
          initial_state=np.zeros(1),
      )
  
      # Anchor to date
      actual = res.simulate(
          2,
          anchor=ix[1],
          state_shocks=np.zeros(2),
          initial_state=np.zeros(1),
      )
      assert_allclose(actual, desired)
      assert_(actual.index.equals(desired.index))
  
      # Anchor to negative index
      actual = res.simulate(
          2,
          anchor=-1,
          state_shocks=np.zeros(2),
          initial_state=np.zeros(1),
      )
      assert_allclose(actual, desired)
      assert_(actual.index.equals(desired.index))
  
imports: from statsmodels.compat.pandas import MONTH_END
  import numpy
  from numpy.testing import assert_, assert_allclose, assert_equal
  import pandas
  import pytest
  from scipy.signal import lfilter
  from statsmodels.tools.sm_exceptions import EstimationWarning, SpecificationWarning
  from statsmodels.tsa.statespace import dynamic_factor, sarimax, structural, varmax
  from .test_impulse_responses import TVSS
label_desc: Use image node_id 42 for calling a global function with example usage: test_pandas_anchor() without return types