code: def test_hamilton_filter_order_zero(self):
      k_regimes = 3
      nobs = 4
      initial_probabilities = np.ones(k_regimes) / k_regimes
  
      # We do not actually transition between the 3 regimes.
      regime_transition = np.eye(k_regimes)[:, :, np.newaxis]
  
      # Regime i correponds to a sequence of iid draws from discrete
      # random variables that are equally likely to be -1 and i for i=0,
      # 1, 2.  We observe the sequence -1, -1, 1, -1.  The first two
      # observations tell us nothing, but the third lets us know that we
      # are in regime 1 the whole time.
      conditional_likelihoods = np.ones((k_regimes, nobs)) / 2
      conditional_likelihoods[:, 2] = [0, 1, 0]
  
      expected_marginals = np.empty((k_regimes, nobs))
      expected_marginals[:, :2] = [[1 / 3], [1 / 3], [1 / 3]]
      expected_marginals[:, 2:] = [[0], [1], [0]]
  
      cy_results = markov_switching.cy_hamilton_filter_log(
          initial_probabilities,
          regime_transition,
          np.log(conditional_likelihoods + 1e-20),
          model_order=0,
      )
      assert_allclose(cy_results[0], expected_marginals, atol=1e-15)
  
imports: import os
  import warnings
  import numpy
  from numpy.testing import assert_allclose, assert_raises
  import pandas
  import pytest
  from statsmodels.tsa.regime_switching import markov_switching, markov_regression
label_desc: Use image node_id 4 for calling the TestFedFundsConstShort obj's underlying member method code with example usage: obj.test_hamilton_filter_order_zero() without return types