code: def test_validate_fixed_params(
      ar_order, ma_order, fixed_params, invalid_fixed_params
  ):
      # test validation with both _validate_fixed_params and directly with
      # hannan_rissanen
  
      endog = np.random.normal(size=100)
      spec = SARIMAXSpecification(
          endog, ar_order=ar_order, ma_order=ma_order
      )
  
      if invalid_fixed_params is None:
          _validate_fixed_params(fixed_params, spec.param_names)
          hannan_rissanen(
              endog,
              ar_order=ar_order,
              ma_order=ma_order,
              fixed_params=fixed_params,
              unbiased=False,
          )
      else:
          valid_params = sorted(
              list(set(spec.param_names) - {"sigma2"})
          )
          msg = (
              f"Invalid fixed parameter(s): {invalid_fixed_params}. "
              f"Please select among {valid_params}."
          )
          # using direct `assert` to test error message instead of `match` since
          # the error message contains regex characters
          with pytest.raises(ValueError) as e:
              _validate_fixed_params(fixed_params, spec.param_names)
              assert e.msg == msg
          with pytest.raises(ValueError) as e:
              hannan_rissanen(
                  endog,
                  ar_order=ar_order,
                  ma_order=ma_order,
                  fixed_params=fixed_params,
                  unbiased=False,
              )
              assert e.msg == msg
  
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose
  from statsmodels.tsa.innovations.arma_innovations import arma_innovations
  from statsmodels.tsa.arima.datasets.brockwell_davis_2002 import lake
  from statsmodels.tsa.arima.estimators.hannan_rissanen import hannan_rissanen, _validate_fixed_params, _package_fixed_and_free_params_info, _stitch_fixed_and_free_params
  from statsmodels.tsa.arima.specification import SARIMAXSpecification
  from statsmodels.tools.tools import Bunch
label_desc: Use image node_id 8 for calling a global function with example usage: test_validate_fixed_params(ar_order, ma_order, fixed_params, invalid_fixed_params) without return types