Jump to

What is time-series forecasting?

Time-series forecasting is a type of statistical or machine learning approach that tries to model historical time-series data in order to make predictions about future time points. 

Challenges of time-series forecasting

Compared to other types of models, time-series forecasting comes with its unique challenges, such as seasonality, holiday effects, data sparsity, and changing trends. Many machine learning techniques don’t work well here due to the sequential nature and temporal correlation of time series. For example, k-fold cross validation can cause data leakage; models need to be retrained to generate new forecasts. The balance between overfitting and underfitting is a tricky act without the ability to randomize the time dimension. With potentially millions of items to forecast, the scalability of any forecasting solution must also be considered. Tasks in addition to forecasting may be important to business such as anomaly detection, uncertainty quantification, and causal inference. Time-series forecasting is not just supervised learning over data with timestamps. Fortunately, Google Cloud offers a wide range of solutions for every business need.

For example, a large retail store may have millions of items to forecast so that inventory is available when demand is high, and not overstocked when demand is low.

Use cases of time-series forecasting

Demand forecasting and capacity planning

Retail demand forecasting for products

Build an end-to-end solution for forecasting demand for retail products. Use historical sales data to train a demand forecasting model using BigQuery ML, and then visualize the forecasted values in a Looker Studio dashboard to share with your stakeholders. Learn about how you can build a demand forecasting solution that can scale to millions of products with Google Cloud with our demand forecasting reference pattern. You may also want to explore how demand forecasting can reduce food waste with our reference pattern.

Commodity price forecasting

Time-series models are used to forecast the prices of commodities that are critical to your business and production processes, and inform your cashflow models and financial plans. 

Cashflow forecasting

Time-series models are typically combined with regression and classification models to produce highly accurate cashflow forecasts based on historical accounting time series along with inputs from transactional data and contractual obligations. Here you can use ARIMA_PLUS with BigQuery ML and combine it with supervised models in BigQuery ML, like GLM, boosted tree models, and AutoML.

  • Supply chain forecasting
    • There are many potential drivers of demand, and for distribution centers, preparing ahead is key to meet consumer demand. Learn how Vertex AI Forecast helps supply chain distribution centers build models that can include signals from weather, product reviews, macroeconomic indicators, competitor actions, commodity prices, freight charges, ocean shipping carrier costs, and more.

Anomaly detection

Anomaly detection with demand forecasting

When it's holidays, gift-giving season, or end-of-year sales, sometimes there are spikes that you expect. But what about when there are spikes (or dips) that you don't expect? For example, how can you spot unusually high (or unusually low) demand that you were not expecting? Learn how you can use anomaly detection with BigQuery ML to find an anomalous spike in bike rentals that happens to coincide with the day that public transportation was disrupted in the city of London.

Manufacturing quality control and metric monitoring

From IoT sensors to production output, monitoring of metrics can come in many forms. However, the common element is to forecast the typical range of these metrics so you can plan ahead and respond as quickly as possible with monitoring systems in place.

Other common use cases for anomaly detection include pricing anomalies due to wrong pricing, real-time anomaly detection, and manufacturing quality control.

Causal inference

Ads effectiveness

How effective were your ads in generating lift for a business? Causal inference can help you look at the statistical significance of ad campaigns.

Impact of major events on time series

You may want to know if the impact of major events, like Brexit, on a time series was statistically significant. Learn more about how you could do causal inference to answer "How did the Brexit vote impact exchange rates between the British Pound and US Dollar?"

Other areas for causal inference analysis include promotions, incentive effectiveness, and price elasticity estimates. 

Time-series forecasting on Google Cloud

BigQuery ML

BigQuery ML enables users to create and execute machine learning models in BigQuery by using standard SQL queries. It supports a model type called ARIMA_PLUS to perform time-series forecasting and anomaly detection tasks.

With ARIMA_PLUS modeling in BigQuery ML, you can make forecasts on millions of time series within a single SQL query, without leaving your data warehouse.

ARIMA_PLUS is essentially a time-series modeling pipeline, which includes the following functionalities:

  • Infer the data frequency of the time series
  • Handle missing data, irregular time intervals, and duplicated timestamps
  • Detect spike and dip outliers and abrupt level changes, and adjust them
  • Handle holiday effects, seasonality, and trends

Tens of millions of time series can be forecast at once with a single query. Different modeling pipelines run in parallel, if enough BigQuery slots are available.

You can get started with BigQuery ARIMA_PLUS with the following tutorials:

For detailed information, please refer to the BigQuery ML public documentation.

Vertex Forecast

Vertex Forecast provides multiple options to users to train the time series forecasting model:

  1. AutoML model. With AutoML training, various feature engineering approaches are first applied, then a fast hyperparameter search will be performed, and then AutoML will explore lots of advanced model architectures including some Google-owned models, and eventually generate a high quality model for you.
  2. Seq2seq plus. In the training process, hyperparameters specifically within the sequence-to-sequence model architecture are used, which can reduce the scope of hyperparameter search space enabling fast convergence.

For detailed information, please refer to Vertex Forecast public documentation.

You can get started with the Vertex Forecasting tutorial.

Custom forecasting

If you want to bring your own custom code, but want to leverage training/serving infrastructure on Google Cloud, you can use Vertex AI Notebooks to run any code in Python, R, TensorFlow, or PyTorch.

Univariate versus multivariate forecasting

With univariate forecasting, you forecast future data using only the historical time series data. For example, to forecast the temperature tomorrow in New York City, univariate forecasting would mean to only use a single variable, historical temperatures, to predict future temperatures. With univariate forecasting, you can also discover seasonal patterns and trends.

With multivariate forecasting, you forecast future data using multiple factors. For example, to forecast the temperature tomorrow in New York City, in addition to using historical temperatures, you could also use barometric pressure, UV index, the percentage of cloud coverage in nearby geographic areas, wind speed, and other variables.

Feeling inspired? Let’s solve your challenges together.

See how you can transform your organization's forecasting with Google cloud.
Contact us
Get hands on learning and try the time-series forecasting codelab today.
Explore the codelab

Learn how BigQuery ML can help your organization. View documentation.

Google offers the ability to manage each and every stage of the data life cycle from running operational transactions, to managing analytical applications across data warehouses and data lakes, to rich data-driven experiences that break down silos. AI/ML is a core component of the data cloud solution, which helps organizations not only build improved insights, but also automate core business processes using data as the core.