FB Prophet
multivariate forecasting
multi-step forecasting
time series analysis
predictive modeling

Is it possible to do multivariate multi-step forecasting using FB Prophet?

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

In recent years, the demand for accurate forecasting has increased across various domains like finance, healthcare, sales, and more. Facebook Prophet is one of the popular tools used for time-series forecasting. It's designed for univariate time-series data, which typically means working with a single time-dependent variable. But what if you have more than one variable to consider, or need predictions over multiple future steps? This article explores whether and how multivariate multi-step forecasting might be achieved using FB Prophet.

Understanding FB Prophet

FB Prophet is an open-source library developed by Facebook, specifically designed for univariate time-series forecasting. It uses an additive model where non-linear time-series data with daily observations get decomposed into trend, seasonality, and holiday components:

y(t)=g(t)+s(t)+h(t)+ϵ_ty(t) = g(t) + s(t) + h(t) + \epsilon\_t

Where:

  • g(t)g(t) is the trend function,
  • s(t)s(t) represents seasonality,
  • h(t)h(t) covers holidays,
  • ϵt\epsilon_t is the error term.

Prophet has built-in capabilities to deal with missing data, outliers, and shifts in the seasonal patterns, which often pose challenges in time-series forecasting.

The Challenge: Multivariate Multi-step Forecasting

Multivariate Forecasting

Traditional multivariate time-series involve multiple endogenous variables. For instance, predicting a company's monthly revenue could depend not just on past revenue data but also on variables like ad spend, website traffic, etc.

Multi-step Forecasting

Multi-step forecasting refers to predicting multiple future steps (e.g., the next 7 days or 12 months) in advance. This is different from one-step forecasts that predict only the immediate next value.

Limitations of FB Prophet

By design, FB Prophet is not intended for multivariate forecasting, as it only allows one dependent variable yy. However, it can handle additional regressors, which are treated as exogenous variables. Prophet does effectively manage multi-step forecasting for the main univariate time-series but still adheres to a univariate framework at its core.

Approaches to Extend Prophet

Below are some strategies to extend Prophet for multivariate forecasting:

Feature Engineering

  1. Include Additional Regressors: While Prophet mainly focuses on one main time-series, you can add influential exogenous variables as additional regressors. These will be considered as external factors influencing the primary time-series.
  2. Temporal Features: You can engineer additional temporal features such as lags, rolling means, etc., and include them as regressors. Though this doesn't make the process truly multivariate, it does enable more nuanced forecasting.

Hybrid Models

  1. Combine with Machine Learning Models: You can use Prophet to forecast the primary series and then employ machine learning models like Random Forests or Neural Networks to capture the complex interactions between multiple variables for the residuals.
  2. Two-step Modeling: First, use Prophet for the primary time-series prediction, then use those predictions, in combination with other relevant variables, as features in another model designed to handle multivariate data.

Multi-step Forecasting Using Prophet

Although Prophet inherently supports multi-step prediction by generating a future dataframe, it's important to recognize that the accuracy of future steps may degrade over longer horizons due to autocorrelation and other complexities not captured in a univariate perspective.

Here's an example of Prophet usage for multi-step forecasting:


Course illustration
Course illustration

All Rights Reserved.