Stay organized with collections
Save and categorize content based on your preferences.
The ML.ARIMA_COEFFICIENTS function
This document describes the ML.ARIMA_COEFFICIENTS function, which lets you
see the ARIMA coefficients and the weights of the external regressors for
ARIMA_PLUS and ARIMA_PLUS_XREG time series models.
Syntax
ML.ARIMA_COEFFICIENTS(
MODEL `PROJECT_ID.DATASET.MODEL`
)
Arguments
ML.ARIMA_COEFFICIENTS takes the following arguments:
PROJECT_ID: your project ID.
DATASET: the BigQuery dataset that contains
the model.
MODEL: the name of the model.
Output
ML.ARIMA_COEFFICIENTS returns the following columns:
time_series_id_col or time_series_id_cols: a value that contains the
identifiers of a time series. time_series_id_col can be an INT64 or
STRING value. time_series_id_cols can be an ARRAY<INT64> or
ARRAY<STRING> value. Only present when forecasting multiple time series
simultaneously. The column names and types are inherited from the
TIME_SERIES_ID_COL option as specified in the model creation query.
ar_coefficients: an ARRAY<FLOAT64> value that contains the autoregressive
coefficients, which corresponds to non-seasonal p.
ma_coefficients: an ARRAY<FLOAT64> value that contains the moving-average
coefficients, which corresponds to non-seasonal q.
intercept_or_drift: a FLOAT64 value that contains 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.
intercept_or_drift is always 0 when non-seasonal d is 2.
processed_input: a STRING value that contains the name of the model
feature input column. The value of this column matches the name of the
feature column provided in the
query_statement clause
that was used when the model was trained.
weight: when the processed_input value is numerical, weight contains a
FLOAT64 value and the category_weights column contains NULL values.
When the processed_input value is non-numerical and has been converted to
dummy encoding, the weight column is NULL and the category_weights
column contains the category names and weights for each category.
category_weights.category: a STRING value that contains the category
name if the processed_input value is non-numeric.
category_weights.weight: a FLOAT64 that contains the category's weight
if the processed_input value is non-numeric.
Example
The following example retrieves the model coefficients information from
the model mydataset.mymodel in your default project:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eML.ARIMA_COEFFICIENTS\u003c/code\u003e function in BigQuery allows users to retrieve the coefficients and external regressor weights from \u003ccode\u003eARIMA_PLUS\u003c/code\u003e and \u003ccode\u003eARIMA_PLUS_XREG\u003c/code\u003e time series models.\u003c/p\u003e\n"],["\u003cp\u003eThis function requires the model's project ID, dataset, and name as arguments in its syntax: \u003ccode\u003eML.ARIMA_COEFFICIENTS(MODEL project_id.dataset.model)\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe function's output includes columns such as \u003ccode\u003ear_coefficients\u003c/code\u003e, \u003ccode\u003ema_coefficients\u003c/code\u003e, \u003ccode\u003eintercept_or_drift\u003c/code\u003e, \u003ccode\u003eprocessed_input\u003c/code\u003e, and \u003ccode\u003eweight\u003c/code\u003e, which provide details about the model's structure and coefficients.\u003c/p\u003e\n"],["\u003cp\u003eWhen a processed_input value is non-numerical, a \u003ccode\u003ecategory_weights\u003c/code\u003e field is provided instead of the \u003ccode\u003eweight\u003c/code\u003e field, which contains the category name and weight for each category.\u003c/p\u003e\n"],["\u003cp\u003eFor \u003ccode\u003eARIMA_PLUS\u003c/code\u003e models, this function returns the ARIMA coefficients for each time series, in ascending order of the \u003ccode\u003etime_series_id_col\u003c/code\u003e or \u003ccode\u003etime_series_id_cols\u003c/code\u003e value.\u003c/p\u003e\n"]]],[],null,["# The ML.ARIMA_COEFFICIENTS function\n==================================\n\nThis document describes the `ML.ARIMA_COEFFICIENTS` function, which lets you\nsee the ARIMA coefficients and the weights of the external regressors for\n`ARIMA_PLUS` and `ARIMA_PLUS_XREG` time series models.\n\nSyntax\n------\n\n```sql\nML.ARIMA_COEFFICIENTS(\n MODEL `PROJECT_ID.DATASET.MODEL`\n)\n```\n\n### Arguments\n\n`ML.ARIMA_COEFFICIENTS` takes the following arguments:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your project ID.\n- \u003cvar translate=\"no\"\u003eDATASET\u003c/var\u003e: the BigQuery dataset that contains the model.\n- \u003cvar translate=\"no\"\u003eMODEL\u003c/var\u003e: the name of the model.\n\nOutput\n------\n\n`ML.ARIMA_COEFFICIENTS` returns the following columns:\n\n- `time_series_id_col` or `time_series_id_cols`: a value that contains the identifiers of a time series. `time_series_id_col` can be an `INT64` or `STRING` value. `time_series_id_cols` can be an `ARRAY\u003cINT64\u003e` or `ARRAY\u003cSTRING\u003e` value. Only present when forecasting multiple time series simultaneously. The column names and types are inherited from the `TIME_SERIES_ID_COL` option as specified in the model creation query.\n- `ar_coefficients`: an `ARRAY\u003cFLOAT64\u003e` value that contains the autoregressive coefficients, which corresponds to non-seasonal p.\n- `ma_coefficients`: an `ARRAY\u003cFLOAT64\u003e` value that contains the moving-average coefficients, which corresponds to non-seasonal q.\n- `intercept_or_drift`: a `FLOAT64` value that contains 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`. `intercept_or_drift` is always `0` when non-seasonal d is `2`.\n- `processed_input`: a `STRING` value that contains the name of the model feature input column. The value of this column matches the name of the feature column provided in the [`query_statement` clause](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create#query_statement) that was used when the model was trained.\n- `weight`: when the `processed_input` value is numerical, `weight` contains a `FLOAT64` value and the `category_weights` column contains `NULL` values. When the `processed_input` value is non-numerical and has been converted to dummy encoding, the `weight` column is `NULL` and the `category_weights` column contains the category names and weights for each category.\n- `category_weights.category`: a `STRING` value that contains the category name if the `processed_input` value is non-numeric.\n- `category_weights.weight`: a `FLOAT64` that contains the category's weight if the `processed_input` value is non-numeric.\n\n| **Note:** For trained `ARIMA_PLUS` models, this function returns the ARIMA coefficients for all time series, in ascending order of the `time_series_id_col` or `time_series_id_cols` value.\n\nExample\n-------\n\nThe following example retrieves the model coefficients information from\nthe model `mydataset.mymodel` in your default project: \n\n```sql\nSELECT\n *\nFROM\n ML.ARIMA_COEFFICIENTS(MODEL `mydataset.mymodel`)\n```\n\nWhat's next\n-----------\n\n- For information about model weights support in BigQuery ML, see [BigQuery ML model weights overview](/bigquery/docs/weights-overview).\n- For information about the supported SQL statements and functions for each model type, see [End-to-end user journey for each model](/bigquery/docs/e2e-journey)."]]