Skip to content
tezvyn:

Prophet: Time Series Forecasting for Seasonal Data

Source: facebook.github.ioMediumHow cards are made

Prophet: Time Series Forecasting for Seasonal Data

Prophet treats a time series as a sum of its parts: a long-term trend, seasonal cycles, and holidays. It's used for business forecasting, like predicting sales, when you have strong seasonal data. The footgun is using it for non-seasonal data.

Why it exists

Traditional forecasting models can be complex and require expert tuning. Businesses needed a tool that was fast, automated, and robust to common data issues like missing values and outliers, while still being tunable by analysts with domain knowledge.

The mental model

Think of Prophet as a "forecasting decomposer." It assumes a time series signal is the sum of three main components: a general growth or decline trend, repeating seasonal patterns (like a spike every Monday), and the effect of specific holidays (like Black Friday). It models each piece separately and then adds them together to create the final forecast.

How it works

Prophet is an additive regression model. It fits a non-linear, piecewise trend to capture long-term changes. It then uses Fourier series to model yearly and weekly seasonality and adds a flexible component for daily patterns if needed. Finally, it incorporates a user-provided list of holidays. The model is fit using Stan, a probabilistic programming language, which makes it fast and robust.

When to use it

Use Prophet when you have time series data with strong seasonal effects and at least one year of history. It's ideal for business planning and goal setting, like forecasting website traffic or sales. Its robustness to missing data, outliers, and trend shifts makes it great for real-world, often "messy" datasets.

When not to use it

Prophet is not the best choice for time series without clear seasonal patterns. It also assumes the components (trend, seasonality) are additive. If your data's variance grows with the trend (a multiplicative relationship), Prophet's default setup may perform poorly. It is a specialized tool, not a universal replacement for all forecasting methods like ARIMA.

One canonical example

An e-commerce company wants to forecast daily sales for the next year. Their historical data shows a clear upward trend, lower sales on weekends, a large spike for Black Friday, and a dip in late December. Prophet can automatically model the overall growth, the weekly and yearly patterns, and the specific holiday effects to produce a reliable forecast that accounts for these distinct components.

Interview question

Which statement accurately describes the core principle behind how Prophet forecasts time series data?

  • a.It focuses exclusively on identifying and extrapolating the most recent historical data points.
  • b.It models the time series as a sum of distinct components, including trend, seasonality, and holidays.Correct
  • c.It uses a single, unified statistical model to capture all underlying patterns simultaneously.
  • d.It primarily relies on complex neural networks to learn and predict future values.
Why?

The card explicitly states, "Think of Prophet as a 'forecasting decomposer.' It assumes a time series signal is the sum of three main components: a general growth or decline trend, repeating seasonal patterns... and the effect of specific holidays." This directly describes option B. Option C is incorrect because Prophet's approach is to decompose the series into separate additive components, not to use a single, unified model for everything.

Just read this? Test yourself on what you have been reading.

Read the original → facebook.github.io

You just looked this up. Could you explain it out loud?

That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on forecasting — each one lists the topics its interview covers.

See open roles