code: def test_auto_ardl():
      """Compare sktime's ARDL interface with statsmodels ardl_select_order."""
      from statsmodels.datasets import longley
      from statsmodels.tsa.ardl import (
          ardl_select_order as _ardl_select_order,
      )
  
      # data
      data = longley.load_pandas().data
      oos = data.iloc[-5:, :]
      data = data.iloc[:-5, :]
      y = data.TOTEMP
      X = data[["GNPDEFL", "GNP"]]
      X_oos = oos[["GNPDEFL", "GNP"]]
      maxlag = 2
      maxorder = 2
      trend = "c"
      # fit
      sm_ardl = _ardl_select_order(
          endog=y, maxlag=maxlag, exog=X, maxorder=maxorder, trend=trend
      )
      res = sm_ardl.model.fit()
      ardl_sktime = ARDL(
          auto_ardl=True, maxlag=maxlag, maxorder=maxorder, trend=trend
      )
      ardl_sktime.fit(y=y, X=X, fh=None)
      # predict
      fh = ForecastingHorizon([0])
      start, end = X.shape[0] + fh[0] - 1, X.shape[0] + fh[-1] - 1
      y_pred_stats = res.predict(start=start, end=end, exog_oos=X_oos)
      y_pred = ardl_sktime.predict(fh=fh, X=X_oos)
      return assert_allclose(y_pred, y_pred_stats)
  
file_path: sktime/sktime/forecasting/tests/test_ardl.py
imports: import pytest
  from numpy.testing import assert_allclose
  from sktime.datasets import load_macroeconomic
  from sktime.forecasting.ardl import ARDL
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.tests.test_switch import run_test_for_class
label_desc: Use image node_id 5 for calling a global function with example usage: test_auto_ardl() and returns: assert_allclose