code: def test_varmax_end_time_varying_trend_noshocks():
      # Test simulating values from the end of a time-varying VARMAX model
      # with a trend
      # In this test, we suppress randomness by setting the shocks to zeros
      endog = np.arange(1, 21).reshape(10, 2)
      mod = varmax.VARMAX(endog, trend="ct")
      res = mod.filter(
          [1.0, 1.0, 1.0, 1.0, 1, 1, 1.0, 1.0, 1.0, 0.5, 1.0]
      )
  
      nsimulations = 10
      measurement_shocks = np.zeros((nsimulations, mod.k_endog))
      state_shocks = np.zeros((nsimulations, mod.k_states))
  
      # Need to set the final predicted state given the new trend
      with res._set_final_predicted_state(exog=None, out_of_sample=10):
          initial_state = res.predicted_state[:, -1].copy()
  
      # Simulation
      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
      tmp_trend = 1 + np.arange(11, 21)
      for i in range(1, nsimulations):
          desired[i] = (
              desired[i - 1].sum() + tmp_trend[i] + 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)
  
      # Alternatively, since we've shut down the shocks, we can compare against
      # the forecast values
      assert_allclose(actual, res.forecast(nsimulations))
  
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 26 for calling a global function with example usage: test_varmax_end_time_varying_trend_noshocks() without return types