code: def test_varmax_end_time_invariant_shocks(reset_randomstate):
      # Test simulating values from the end of a time-invariant VARMAX model,
      # with nonzero shocks
      endog = np.arange(1, 21).reshape(10, 2)
      mod = varmax.VARMAX(endog, trend="n")
      res = mod.filter([1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 1.0])
  
      nsimulations = 10
      measurement_shocks = np.random.normal(
          size=(nsimulations, mod.k_endog)
      )
      state_shocks = np.random.normal(size=(nsimulations, mod.k_states))
      initial_state = res.predicted_state[:, -1]
  
      actual = res.simulate(
          nsimulations,
          anchor="end",
          measurement_shocks=measurement_shocks,
          state_shocks=state_shocks,
          initial_state=initial_state,
      )
  
      desired = np.zeros((nsimulations, mod.k_endog))
      desired[0] = initial_state
      for i in range(1, nsimulations):
          desired[i] = desired[i - 1].sum() + state_shocks[i - 1]
      desired = desired + measurement_shocks
      assert_allclose(actual, desired)
  
      # Test using the model versus the results class
      mod_actual = mod.simulate(
          res.params,
          nsimulations,
          anchor="end",
          measurement_shocks=measurement_shocks,
          state_shocks=state_shocks,
          initial_state=initial_state,
      )
  
      assert_allclose(mod_actual, desired)
  
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 25 for calling a global function with example usage: test_varmax_end_time_invariant_shocks(reset_randomstate) without return types