Time Series2018beginner10 min read

Forecasting at Scale

التنبؤ على نطاق واسع

Taylor, S. J. · Letham, B. — The American Statistician

The problem

By 2017, organizations needed thousands of reliable forecasts — for planning, goal setting, and anomaly detection — but faced two problems. Fully automatic methods like ARIMA were brittle and could not easily incorporate domain knowledge such as holidays or product launches. Meanwhile, analysts who could build good forecasts were rare, because modeling requires specialized expertise. The gap between demand for forecasts and the ability to produce them was growing fast.

The contribution

Prophet: a decomposable time series model built as a (GAM) with three interpretable components — a piecewise growth (linear or logistic), Fourier-based multi-period , and holiday effects. The model fits fast via L-BFGS or full in Stan, and its parameters are designed so that analysts without statistics training can adjust them using domain knowledge. The paper also introduces Simulated Historical Forecasts (SHFs) for automated, scalable evaluation and comparison of forecasting methods.

The impact

Prophet became one of the most widely adopted forecasting tools in industry, powering thousands of forecasts at Facebook and across organizations worldwide. Its open-source implementation in Python and R lowered the barrier to quality forecasting for non-specialists. The philosophy influenced how teams think about the forecasting pipeline — not as a black box, but as a collaboration between human expertise and statistical models. Prophet also popularized the GAM-based approach for business time series.

Imagine predicting tomorrow's traffic on a busy highway. You would not try to capture every car — instead, you would layer three transparent maps: one showing the long-term growth of the city, one showing rush-hour and weekend patterns that repeat every week, and one marking holidays when traffic drops. Stack the maps, and you have a surprisingly good — without needing to be a traffic engineer.

Prophet does exactly this for any business metric: it separates the signal into a trend sheet, a seasonality sheet, and a holiday sheet, then adds them up.

The problem: forecasting at scale is a human problem

When Taylor and Letham say "at scale," they do not mean computational scale — fitting thousands of time series is straightforward to parallelize. They mean three kinds of human scale:

  1. Many people need to make forecasts, most without training in time series methods.
  2. Many varieties of time series, each with idiosyncratic features like product launches or regional holidays.
  3. Many forecasts must be monitored, compared, and corrected efficiently.

The traditional pipeline — hand an expert a single time series to study for days — collapses when an organization needs hundreds of forecasts per week. The authors' solution is an analyst-in-the-loop system: an interpretable model whose parameters an analyst can adjust with domain knowledge, combined with automated evaluation tools that surface the forecasts most likely to need human attention.

Open in Lab
The analyst-in-the-loop pipeline: the model produces forecasts, automated evaluation flags problems, and the analyst adjusts parameters using domain knowledge.
The demo wakes as you arrive…

The core idea: decompose time series into interpretable layers

Prophet models a time series as the sum of three components plus noise. Think of it as three transparent layers stacked on top of each other, each capturing a different pattern. The growth layer g(t)g(t) captures the long-term trajectory — is the metric going up, flattening, or declining? The seasonality layer s(t)s(t) captures repeating cycles — weekly patterns, yearly patterns, or both. The holiday layer h(t)h(t) captures irregular spikes and dips from holidays and special events. Whatever is left over goes into the noise term ϵt\epsilon_t.

This additive structure is what makes the model interpretable: you can look at each layer separately and understand what is driving the forecast.

y(t)=g(t)+s(t)+h(t)+ϵty(t) = g(t) + s(t) + h(t) + \epsilon_t
Prophet decomposition — the master equation — The observed value y(t)y(t) at time tt is the sum of a growth function g(t)g(t), a seasonality function s(t)s(t), a holiday function h(t)h(t), and a noise term ϵt\epsilon_t assumed to be normally distributed. This is a Generalized Additive Model (GAM) where time is the only regressor.
Open in Lab
Toggle each component on or off to see how trend, seasonality, and holidays combine to form the final forecast.
The demo wakes as you arrive…

Growth: modeling the long-term trajectory

The growth component g(t)g(t) captures the non-periodic trend — the big picture of where the metric is heading. Prophet offers two growth models depending on the nature of the data.

Logistic growth is used when there is a natural upper limit — a . For example, the number of Facebook users in a country is bounded by the number of people with internet access. The classic logistic curve has the S-shape of population growth: slow start, rapid rise, then saturation.

Linear growth is used when no natural saturation exists — for example, revenue or page views that could in principle grow indefinitely. This is simply a piecewise line with slope changes at key moments.

In both cases, Prophet allows the growth rate to change at specific points called changepoints. A product launch might accelerate growth; a competitor's entry might slow it. Rather than fitting a single curve that cannot bend, Prophet fits a flexible piecewise curve that can adapt to shifts in the underlying dynamics.

g(t)=C(t)1+exp⁡ ⁣(−(k+a(t)⊤δ) (t−(b+a(t)⊤γ)))g(t) = \frac{C(t)}{1 + \exp\!\bigl(-(k + \mathbf{a}(t)^\top \boldsymbol{\delta})\,(t - (b + \mathbf{a}(t)^\top \boldsymbol{\gamma}))\bigr)}
Piecewise logistic growth with changepoints — C(t)C(t) is the time-varying carrying capacity. kk is the base growth rate, and δ\boldsymbol{\delta} is a vector of rate adjustments at each changepoint. The indicator vector a(t)\mathbf{a}(t) activates the adjustments that apply by time tt. The offset γ\boldsymbol{\gamma} ensures the segments connect smoothly. By placing a Laplace prior on δ\boldsymbol{\delta}, most changepoints are automatically driven to zero — only the real shifts survive.
Open in Lab
Adjust the changepoint flexibility τ and see how the model balances between a rigid global trend and a flexible local fit.
The demo wakes as you arrive…

Seasonality: capturing repeating rhythms with Fourier series

Business metrics reflect human behavior, and humans are creatures of routine. People check social media more on weekdays, shop more before holidays, and travel more in summer. These repeating patterns are the seasonality component s(t)s(t).

Prophet approximates seasonality using a — a sum of sine and cosine waves at different frequencies. Think of it like tuning a radio: each frequency captures a different rhythmic cycle. For weekly seasonality, Prophet uses N=3N=3 Fourier terms (capturing the broad weekday vs weekend pattern). For yearly seasonality, N=10N=10 terms are typical (capturing finer distinctions like summer vacations and back-to-school periods).

The key advantage: you do not need to hand-specify what day-of-week effects look like. The Fourier basis automatically learns the shape from data.

s(t)=∑n=1N(ancos⁡ ⁣(2πntP)+bnsin⁡ ⁣(2πntP))s(t) = \sum_{n=1}^{N} \Bigl( a_n \cos\!\Bigl(\frac{2\pi n t}{P}\Bigr) + b_n \sin\!\Bigl(\frac{2\pi n t}{P}\Bigr) \Bigr)
Fourier seasonality — periodic patterns as wave sums — PP is the period (e.g. 365.25 days for yearly, 7 for weekly). NN controls how complex the seasonal pattern can be. Each pair (an,bn)(a_n, b_n) captures one frequency. A normal prior β∼Normal(0,σ)\beta \sim \text{Normal}(0, \sigma) on the coefficients prevents overfitting by smoothing the seasonal curve.
Open in Lab
Add or remove Fourier terms to see how the seasonal pattern changes in complexity. Too few terms miss the pattern; too many overfit.
The demo wakes as you arrive…

Holidays: handling irregular calendar shocks

Holidays like Thanksgiving (fourth Thursday in November) or the Super Bowl do not fall on the same date each year, so smooth seasonal curves cannot model them. Prophet handles this with a separate holiday component.

The analyst provides a table of holiday names and dates — past and future. Each holiday ii gets its own parameter κi\kappa_i that measures its impact on the metric. The model can also include windows of days around a holiday. For instance, people behave differently in the days leading up to Christmas and after it.

This is one of Prophet's most practical features: by simply listing the holidays relevant to a country or business, the model automatically learns their effects without any statistical tuning.

h(t)=∑i=1Lκi⋅1(t∈Di)h(t) = \sum_{i=1}^{L} \kappa_i \cdot \mathbf{1}(t \in D_i)
Holiday effects — indicator-based shocks — For each holiday ii, DiD_i is the set of dates for that holiday across all years. The indicator 1(t∈Di)\mathbf{1}(t \in D_i) is 1 on holiday dates and 0 elsewhere. Each κi\kappa_i is learned from data with a prior κ∼Normal(0,ν)\kappa \sim \text{Normal}(0, \nu), where ν\nu controls how flexibly the model can accommodate holiday effects.

Fitting: fast estimation with analyst-friendly parameters

Prophet frames forecasting as a curve-fitting problem rather than a generative time series model. This is a deliberate trade-off: it gives up the temporal dependence modeling of ARIMA (where each observation depends on the previous ones) in exchange for speed, flexibility, and interpretability.

The model is implemented in Stan and can be fit in two ways. The default is MAP estimation using L-BFGS — the same optimizer used in — which takes seconds even for years of daily data. When full uncertainty quantification is needed, Prophet supports full Bayesian inference via Hamiltonian Monte Carlo sampling in Stan.

The critical design choice is that the model has a small number of analyst-interpretable parameters. The table below summarizes them. An analyst does not need to understand Fourier series or Laplace priors — they just turn a knob labeled "how flexible should the trend be?" or "how strong is the seasonality?"

Stan-style pseudocode for Prophet modelpython

Simplified to show the idea — not the real implementation.

# Priors k ~ Normal(0, 5)           # base growth rate b ~ Normal(0, 5)           # offset delta ~ Laplace(0, tau)    # changepoint rate adjustments beta ~ Normal(0, sigma)    # seasonality coefficients
# Likelihood (logistic growth version) y ~ Normal(
    C / (1 + exp(-(k + A*delta) * (t - (b + A*gamma))))
    + X*beta,              # seasonality + holidays
    epsilon
)

Evaluation: Simulated Historical Forecasts

How do you know if your forecast model is any good? You cannot use standard because time series observations are not exchangeable — you cannot randomly shuffle dates.

Prophet introduces Simulated Historical Forecasts (SHFs): you pick multiple cutoff dates in the past, pretend you only have data up to that point, generate a forecast for the next HH days, then compare the forecast to what actually happened. This simulates the errors you would have made if you had used this method at that point in history.

By computing SHFs across multiple cutoff dates and comparing against baseline methods (naive, seasonal naive, ARIMA, exponential smoothing), Prophet can automatically surface forecasts that are performing poorly and flag them for human review. This is what makes the analyst-in-the-loop system work at scale: instead of checking every forecast, the analyst focuses on the ones the system identified as problematic.

Open in Lab
Simulated Historical Forecasts: pick different cutoff dates and see how forecast errors accumulate over the horizon.
The demo wakes as you arrive…

Prophet vs ARIMA: different philosophies

ARIMA and Prophet represent fundamentally different approaches to time series. ARIMA is a generative model that explicitly accounts for the temporal dependence structure — each value depends on previous values. It is mathematically elegant and has strong inferential properties, but it requires regularly spaced data, careful differencing to achieve stationarity, and expertise to select orders (p,d,q)(p, d, q).

Prophet treats forecasting as curve fitting. It does not model the autocorrelation structure at all. Instead, it directly models the patterns humans care about — trend, seasons, and holidays — and leaves the residuals as unstructured noise. This makes it less rigorous theoretically, but far more practical for the analyst-in-the-loop scenario where speed, interpretability, and flexibility matter more than inferential guarantees.

Prophet can also handle missing data naturally (no interpolation needed), irregular spacing, and multiple seasonality periods — all of which are painful with ARIMA.

Timeline: from Prophet to modern forecasting

  1. 2017

    Prophet released

    Taylor and Letham release Prophet as open-source software in Python and R. The paper appears on PeerJ Preprints.

  2. 2018

    Published in The American Statistician

    The paper is published in its final form. Prophet is already widely adopted at Facebook for capacity planning and goal setting across thousands of time series.

  3. 2019

    DeepAR and neural forecasting

    Amazon's DeepAR uses autoregressive RNNs to produce probabilistic forecasts, representing a shift toward deep learning methods for time series.

  4. 2020

    N-BEATS

    A pure deep-learning architecture for time series forecasting that outperforms statistical methods on the M4 competition, without any time-series-specific inductive biases.

  5. 2023

    Foundation models for time series

    TimesFM and other foundation models apply the pre-train → fine-tune paradigm to time series, training on millions of diverse series and achieving zero-shot forecasting.

CitationTaylor, S. J. and Letham, B.. Forecasting at Scale. The American Statistician, 2018.

Terms in this paper