The ML.ARIMA_COEFFICIENTS function

ML.ARIMA_COEFFICIENTS function

The ML.ARIMA_COEFFICIENTS function lets you see the ARIMA coefficients and the weights of the external regressors. This function only applies to the time-series ARIMA_PLUS, ARIMA_PLUS_XREG and ARIMA models.

For information about model weights support in BigQuery ML, see Model weights overview.

For information about supported model types of each SQL statement and function, and all supported SQL statements and functions for each model type, read End-to-end user journey for each model.

ML.ARIMA_COEFFICIENTS syntax

ML.ARIMA_COEFFICIENTS(MODEL `project_id.dataset.model`)

Where:

  • project_id: your project ID
  • dataset: the BigQuery dataset that contains the model
  • model: the name of the model

ML.ARIMA_COEFFICIENTS output

The ML.ARIMA_COEFFICIENTS function returns the following columns:

  • time_series_id_col or time_series_id_cols: the identifiers of a time series. Only present when forecasting multiple time series at once. The column names and types are inherited from the TIME_SERIES_ID_COL option as specified in the model creation query.
  • ar_coefficients (ARRAY<FLOAT64>): the autoregressive coefficients, which corresponds to non-seasonal p.
  • ma_coefficients (ARRAY<FLOAT64>): the moving-average coefficients, which corresponds to non-seasonal q.
  • intercept_or_drift (FLOAT64): the constant term of the ARIMA model. By definition, the constant term is called “intercept” when non-seasonal d is 0, and “drift” when non-seasonal d is 1. It is always 0 when non-seasonal d is 2.
  • processed_input (STRING): The name of the model feature input. The value of this column matches the name of the column in the SELECT statement used during training.
  • weight (FLOAT64): For numerical columns, weight contains a value and the category_weights column is NULL. For non-numeric columns that are converted to dummy encoding, the weight column is NULL and the category_weights column is an ARRAY of category names and weights for each category.
  • category_weights.category (STRING): The category name if the input column is non-numeric.
  • category_weights.weight (FLOAT64) The category's weight if the input column is non-numeric.

ML.ARIMA_COEFFICIENTS examples

The following example retrieves the model coefficients information from mymodel in mydataset. The dataset is in your default project.

SELECT
  *
FROM
  ML.ARIMA_COEFFICIENTS(MODEL `mydataset.mymodel`)