11 — Advanced Models

Prophet#

AdvancedStatistical
◆ The PatternDecomposable forecasting at scale

Facebook’s Prophet fits an additive model: y(t) = g(t) + s(t) + h(t) + ε. The trend g(t) can be linear or logistic (saturating). Seasonality s(t) uses Fourier series. Holidays h(t) handle irregular events. Changepoints are detected automatically.

y(t) = g(t) + s(t) + h(t) + εt
g(t) = trend (linear/logistic), s(t) = seasonality (Fourier), h(t) = holidays/events. All components are interpretable.
// Interactive — Prophet component decomposition
Pattern bridge: Prophet’s Fourier seasonality connects to sinusoidal positional encodings in LLMs. Its trend changepoints are exactly the changepoint detection problem — and in markets, they correspond to breakout moments.
Worked example

Four years of growth at 1 a month, then 8 months at 3 a month. A trend model that extends the latest segment forecasts 227 two years out; the overall slope (1.13) gives 188. Prophet’s piecewise trend behaves like the first: whatever happened since the last changepoint is projected forward with confidence.

Where it misleads
  • Its intervals capture trend uncertainty only roughly, so they are often too narrow for long horizons.
  • Independent comparisons have often found well-tuned exponential smoothing or ARIMA as accurate or better; treat Prophet as one candidate, not a default.
  • Holiday and changepoint settings are powerful and easy to overfit.
In code
t = np.arange(48)                                 # four years, monthly
y = np.where(t < 40, 100 + 1.0 * t, 140 + 3.0 * (t - 40))   # growth triples in the last 8 months
h = 24
last_slope = (y[-1] - y[-9]) / 8                  # the most recent trend segment
overall = np.polyfit(t, y, 1)[0]
f_last = y[-1] + last_slope * h
f_overall = y[-1] + overall * h
Python, in your browser — edit the code and run it again

Assumes import numpy as np and import pandas as pd. Each snippet simulates or makes up its own series, as the comments say.

The same idea with a library
# Python — Prophet
from prophet import Prophet

model = Prophet(
    changepoint_prior_scale=0.05,
    seasonality_mode='additive'
)
model.fit(df[['ds', 'y']])
future = model.make_future_dataframe(periods=365)
forecast = model.predict(future)
model.plot_components(forecast)
Sources
  • S. J. Taylor & B. Letham, “Forecasting at Scale”, The American Statistician 72(1), 2018
  • Forecasting: Principles and Practice (3rd ed.), R. J. Hyndman & G. Athanasopoulos, OTexts, 2021

Last reviewed October 2026 · How this site checks its content · Report a mistake

Linked from 1
← Previous
Exponential Smoothing
Open in the full reader, with the topic sidebar