code: def test_against_statsmodels_exog():
      """Compare sktime's autoReg interface with statsmodels autoReg, with exog data."""
      from statsmodels.tsa.ar_model import AutoReg as _AutoReg
  
      from sktime.datasets import load_longley
  
      # data
      y, X_og = load_longley()
      X_oos = X_og.iloc[-5:, :]
      y = y.iloc[:-5]
      X = X_og.iloc[:-5, :]
      X = X[["GNPDEFL", "GNP"]]
      X_oos = X_oos[["GNPDEFL", "GNP"]]
      # fit
      sm_autoreg = _AutoReg(endog=y, lags=2, exog=X, trend="c")
      res = sm_autoreg.fit()
      autoreg_sktime = AutoREG(lags=2, trend="c")
      autoreg_sktime.fit(y=y, X=X, fh=None)
      # predict
      fh = ForecastingHorizon([1, 2, 3])
      start, end = X.shape[0] + fh[0] - 1, X.shape[0] + fh[-1] - 1
      y_pred_stats = sm_autoreg.predict(
          res.params, start=start, end=end, exog=X, exog_oos=X_oos
      )
      y_pred = autoreg_sktime.predict(fh=fh, X=X_oos)
      return assert_allclose(y_pred, y_pred_stats)
  
imports: import pytest
  from numpy.testing import assert_allclose
  from sktime.forecasting.auto_reg import AutoREG
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.utils.validation._dependencies import _check_estimator_deps
label_desc: Use image node_id 3 for calling a global function with example usage: test_against_statsmodels_exog() and returns: assert_allclose