Stay organized with collectionsSave and categorize content based on your preferences.
Forecasting overview
Forecasting is a technique where you analyze historical data in order to make an
informed prediction about future trends. For example, you might analyze
historical sales data from several store locations in order to predict future
sales at those locations. In BigQuery ML, you perform forecasting ontime seriesdata.
You can perform forecasting in the following ways:
By using theAI.FORECASTfunctionwith the built-inTimesFM model. Use this approach when you
need to forecast future values for a single variable, and don't require the
ability to fine-tune the model. This approach doesn't require you to create
and manage a model.
By using theML.FORECASTfunctionwith theARIMA_PLUSmodel.
Use this approach when you need to run an ARIMA-based modeling pipeline and
decompose the time series into multiple components in order to explain the
results. This approach requires you to create and manage a model.
By using theML.FORECASTfunction with theARIMA_PLUS_XREGmodel.
Use this approach when you need to forecast future values for multiple
variables. This approach requires you to create and manage a model.
ARIMA_PLUSandARIMA_PLUS_XREGtime series models aren't actually single
models, but rather a time series modeling pipeline that includes multiple
models and algorithms. For more information, seeTime series modeling pipeline.
In addition to forecasting, you can useARIMA_PLUSandARIMA_PLUS_XREGmodels for anomaly detection. For more information, see the following
documents:
Use the following table to determine whether to useAI.FORECASTwith the
built-in TimesFM model orML.FORECASTwith anARIMA_PLUSorARIMA_PLUS_XREGmodel for your use case:
Statistical model that uses theARIMAalgorithm for the
trend component, and a variety of other algorithms for non-trend
components. For more information, seeTime series modeling pipeline.
Training required
No, the TimesFM model is pre-trained.
Yes, oneARIMA_PLUSorARIMA_PLUS_XREGmodel is trained for each time series.
SQL ease of use
Very high. Requires a single function call.
High. Requires aCREATE MODELstatement and a
function call.
Data history used
Uses 512 time points.
Uses all time points in the training data, but can be customized to
use fewer time points.
By using the default settings of BigQuery ML's statements and
functions, you can create and use a forecasting model even
without much ML knowledge. However, having basic knowledge about
ML development, and forecasting models in particular,
helps you optimize both your data and your model to
deliver better results. We recommend using the following resources to develop
familiarity with ML techniques and processes:
[[["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-09-04 UTC."],[[["\u003cp\u003eForecasting involves analyzing historical data to predict future trends, such as using past sales data to forecast future sales at store locations.\u003c/p\u003e\n"],["\u003cp\u003eIn BigQuery ML, forecasting is performed on time series data, which are data points collected over time.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eML.FORECAST\u003c/code\u003e function, along with the \u003ccode\u003eARIMA_PLUS\u003c/code\u003e and \u003ccode\u003eARIMA_PLUS_XREG\u003c/code\u003e models, are used to forecast future values for single or multiple variables, respectively.\u003c/p\u003e\n"],["\u003cp\u003eTime series modeling in BigQuery ML is a pipeline consisting of multiple models and algorithms.\u003c/p\u003e\n"],["\u003cp\u003eWhile deep ML knowledge is not mandatory, having a foundational understanding can help optimize your data and model to improve results.\u003c/p\u003e\n"]]],[],null,["# Forecasting overview\n====================\n\nForecasting is a technique where you analyze historical data in order to make an\ninformed prediction about future trends. For example, you might analyze\nhistorical sales data from several store locations in order to predict future\nsales at those locations. In BigQuery ML, you perform forecasting on\n[time series](https://en.wikipedia.org/wiki/Time_series) data.\n\nYou can perform forecasting in the following ways:\n\n- By using the [`AI.FORECAST` function](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-forecast) with the built-in [TimesFM model](/bigquery/docs/timesfm-model). Use this approach when you need to forecast future values for a single variable, and don't require the ability to fine-tune the model. This approach doesn't require you to create and manage a model.\n- By using the [`ML.FORECAST` function](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-forecast) with the [`ARIMA_PLUS` model](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-time-series). Use this approach when you need to run an ARIMA-based modeling pipeline and decompose the time series into multiple components in order to explain the results. This approach requires you to create and manage a model.\n- By using the `ML.FORECAST` function with the [`ARIMA_PLUS_XREG` model](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-multivariate-time-series). Use this approach when you need to forecast future values for multiple variables. This approach requires you to create and manage a model.\n\n`ARIMA_PLUS` and `ARIMA_PLUS_XREG` time series models aren't actually single\nmodels, but rather a time series modeling pipeline that includes multiple\nmodels and algorithms. For more information, see\n[Time series modeling pipeline](/bigquery/docs/reference/standard-sql/bigqueryml-syntax-create-time-series#modeling-pipeline).\n\nCompare the TimesFM and `ARIMA` models\n--------------------------------------\n\nUse the following table to determine whether to use `AI.FORECAST` with the\nbuilt-in TimesFM model or `ML.FORECAST` with an `ARIMA_PLUS` or\n`ARIMA_PLUS_XREG` model for your use case:\n\nRecommended knowledge\n---------------------\n\nBy using the default settings of BigQuery ML's statements and\nfunctions, you can create and use a forecasting model even\nwithout much ML knowledge. However, having basic knowledge about\nML development, and forecasting models in particular,\nhelps you optimize both your data and your model to\ndeliver better results. We recommend using the following resources to develop\nfamiliarity with ML techniques and processes:\n\n- [Machine Learning Crash Course](https://developers.google.com/machine-learning/crash-course)\n- [Intro to Machine Learning](https://www.kaggle.com/learn/intro-to-machine-learning)\n- [Intermediate Machine Learning](https://www.kaggle.com/learn/intermediate-machine-learning)\n- [Time Series](https://www.kaggle.com/learn/time-series)"]]