code: def test_autoreg(daily_data):
      """Runs a basic model with uncertainty intervals
      and checks coverage"""
      uncertainty_dict = {
          "uncertainty_method": "simple_conditional_residuals",
          "params": {
              "conditional_cols": ["dow_hr"],
              "quantiles": [0.025, 0.975],
              "quantile_estimation_method": "normal_fit",
              "sample_size_thresh": 10,
              "small_sample_size_method": "std_quantiles",
              "small_sample_size_quantile": 0.98,
          },
      }
  
      model = SilverkiteEstimator(
          uncertainty_dict=uncertainty_dict, autoreg_dict="auto"
      )
      train_df = daily_data["train_df"]
      test_df = daily_data["test_df"][:20]
      model.fit(
          train_df, time_col=cst.TIME_COL, value_col=cst.VALUE_COL
      )
      assert model.forecast is None
  
      trained_model = model.model_dict
      pred_cols = trained_model["pred_cols"]
  
      expected_autoreg_terms = {
          "y_lag30",
          "y_lag31",
          "y_lag32",
          "y_avglag_35_42_49",
          "y_avglag_30_to_36",
          "y_avglag_37_to_43",
      }
      assert expected_autoreg_terms.issubset(pred_cols)
  
      predictions = model.predict(test_df)
      expected_forecast_cols = {
          "ts",
          "y",
          cst.QUANTILE_SUMMARY_COL,
          "err_std",
          "forecast_lower",
          "forecast_upper",
      }
  
      assert expected_forecast_cols.issubset(
          list(model.forecast.columns)
      )
  
      actual = test_df[cst.VALUE_COL]
      forecast_lower = predictions[cst.PREDICTED_LOWER_COL]
      forecast_upper = predictions[cst.PREDICTED_UPPER_COL]
      calc_pred_coverage = (
          100
          * (
              (actual <= forecast_upper) & (actual >= forecast_lower)
          ).mean()
      )
      assert (
          round(calc_pred_coverage) >= 75
      ), "forecast coverage is incorrect"
  
      # Simulation based, default forecast horizon
      model = SilverkiteEstimator(
          uncertainty_dict=uncertainty_dict,
          autoreg_dict="auto",
          simulation_based=True,
      )
      train_df = daily_data["train_df"]
      test_df = daily_data["test_df"][:20]
      model.fit(
          train_df, time_col=cst.TIME_COL, value_col=cst.VALUE_COL
      )
      assert model.forecast is None
  
      trained_model = model.model_dict
      pred_cols = trained_model["pred_cols"]
  
      expected_autoreg_terms = {
          "y_lag1",
          "y_lag2",
          "y_lag3",
          "y_avglag_7_14_21",
          "y_avglag_1_to_7",
          "y_avglag_8_to_14",
      }
      assert expected_autoreg_terms.issubset(pred_cols)
  
      # Passes forecast horizon of 10
      model = SilverkiteEstimator(
          uncertainty_dict=uncertainty_dict,
          autoreg_dict="auto",
          forecast_horizon=10,
      )
      train_df = daily_data["train_df"]
      test_df = daily_data["test_df"][:20]
      model.fit(
          train_df, time_col=cst.TIME_COL, value_col=cst.VALUE_COL
      )
      assert model.forecast is None
  
      trained_model = model.model_dict
      pred_cols = trained_model["pred_cols"]
  
      expected_autoreg_terms = {
          "y_lag10",
          "y_lag11",
          "y_lag12",
          "y_avglag_14_21_28",
          "y_avglag_10_to_16",
          "y_avglag_17_to_23",
      }
      assert expected_autoreg_terms.issubset(pred_cols)
  
      # Passes forecast horizon of 10, and simulation-based True
      model = SilverkiteEstimator(
          uncertainty_dict=uncertainty_dict,
          autoreg_dict="auto",
          forecast_horizon=10,
          simulation_based=True,
      )
      train_df = daily_data["train_df"]
      test_df = daily_data["test_df"][:20]
      model.fit(
          train_df, time_col=cst.TIME_COL, value_col=cst.VALUE_COL
      )
      assert model.forecast is None
  
      trained_model = model.model_dict
      pred_cols = trained_model["pred_cols"]
  
      expected_autoreg_terms = {
          "y_lag1",
          "y_lag2",
          "y_lag3",
          "y_avglag_7_14_21",
          "y_avglag_1_to_7",
          "y_avglag_8_to_14",
      }
      assert expected_autoreg_terms.issubset(pred_cols)
  
imports: import datetime
  import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from sklearn.linear_model import SGDRegressor
  from sklearn.metrics import mean_squared_error
  import greykite.common.constants
  from greykite.algo.forecast.silverkite.forecast_silverkite import SilverkiteForecast
  from greykite.common.features.timeseries_features import convert_date_to_continuous_time
  from greykite.common.features.timeseries_impute import impute_with_lags
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import daily_data_reg
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.common.testing_utils import generate_df_with_reg_for_tests
  from greykite.sklearn.estimator.silverkite_estimator import SilverkiteEstimator
  from greykite.sklearn.estimator.testing_utils import params_component_breakdowns
  from greykite.sklearn.estimator.testing_utils import params_components
label_desc: Use image node_id 14 for calling a global function with example usage: test_autoreg(daily_data) without return types