code: def test_fmols_eviews(trivariate_data, test_key):
      y, x = trivariate_data
      trend, x_trend, diff = test_key
      key = (trend, x_trend, diff)
      test_res = setup_test_values(FMOLS_RES[key])
      mod = FullyModifiedOLS(y, x, trend, x_trend)
      # BW is one less than what Eviews reports
      res = mod.fit(
          bandwidth=6, force_int=True, diff=diff, df_adjust=True
      )
      if trend != "ctt":
          assert_allclose(res.params, test_res.params, rtol=1e-4)
          assert_allclose(res.std_errors, test_res.se, rtol=1e-3)
          assert_allclose(res.tvalues, test_res.tstats, rtol=1e-3)
      else:
          # Do not match results when ctt since Eviews adds the trend and trend**2
          # after shortening the series, so that the trend for the second observations
          # is 1, while we use the trend fo rthe second observation as 2 (and tt as 4)
          assert_allclose(
              res.params.iloc[:3], test_res.params.iloc[:3], rtol=1e-4
          )
          assert_allclose(
              res.std_errors.iloc[:3], test_res.se.iloc[:3], rtol=1e-3
          )
          assert_allclose(
              res.tvalues.iloc[:3], test_res.tstats.iloc[:3], rtol=1e-3
          )
      if trend != "n":
          # Eviews seems to center even with no trend
          assert_allclose(res.rsquared, test_res.rsquared, rtol=1e-4)
          assert_allclose(
              res.rsquared_adj, test_res.rsquared_adj, rtol=1e-4
          )
      # Loose tolerance since I use 1000 obs while Eviews drops 1
      assert_allclose(
          res.residual_variance, test_res.short_run, rtol=2e-3
      )
      assert_allclose(
          res.long_run_variance, test_res.long_run, rtol=1e-4
      )
  
      assert isinstance(res.summary(), Summary)
  
file_path: arch/arch/tests/unitroot/test_fmols_ccr.py
imports: from typing import NamedTuple
  from numpy.testing import assert_allclose
  import pandas
  import pytest
  from statsmodels.iolib.summary import Summary
  from arch.unitroot.cointegration import CanonicalCointegratingReg, FullyModifiedOLS
label_desc: Use image node_id 5 for calling a global function with example usage: test_fmols_eviews(trivariate_data, test_key) without return types