Dokumentation (english)

Prophet

Automatic forecasting for time series with strong seasonal patterns and missing data

Prophet is a forecasting library developed by Facebook (now Meta) designed to make time series forecasting accessible to analysts without deep statistical expertise. It handles missing data, outliers, and seasonal patterns automatically.

How Prophet Works

Prophet decomposes time series into three main components:

Trend: Captures long-term changes using piecewise linear or logistic growth curves. The model automatically detects changepoints where growth rate shifts.

Seasonality: Models repeating patterns at different scales—daily, weekly, yearly—using Fourier series. You can add custom seasonal periods.

Holidays: Incorporates known events that affect the series differently from regular seasonal patterns.

The model combines these additively:

y(t)=g(t)+s(t)+h(t)+ϵty(t) = g(t) + s(t) + h(t) + \epsilon_t

Where g(t) is trend, s(t) is seasonality, h(t) is holidays, and ε is error.

Key Features

Prophet makes reasonable assumptions by default. It automatically detects changepoints in the trend, handles missing data without imputation, and fits quickly using Stan's optimizer. You can easily incorporate domain knowledge by adding custom holidays, seasonal periods, or external regressors.

The library provides uncertainty intervals for forecasts and allows you to tune the tradeoff between fitting historical data and projecting trends forward. Prophet is also robust to outliers—occasional extreme values don't break the model.

When to Use Prophet

Prophet works best when you have at least several months of historical data with strong seasonal effects at multiple scales. It excels with daily or hourly data that has weekly and yearly patterns, like website traffic, retail sales, or energy consumption.

Use Prophet when you need fast, automated forecasts without extensive tuning. It's particularly valuable when domain experts need to understand and adjust forecasts—the interpretable components make it easy to explain predictions and incorporate business knowledge through custom holidays and events.

Prophet is less suitable for very short time series (less than a few months), data without clear seasonal patterns, or when you need to model complex interactions between many external variables. In those cases, consider ARIMA for short series, tree-based models for complex feature interactions, or neural networks for large datasets with intricate patterns.

Practical Considerations

Tuning seasonality: Prophet automatically fits yearly and weekly seasonality. Add daily seasonality for sub-daily data or custom seasonal periods for domain-specific patterns.

Changepoint detection: By default, Prophet fits 25 potential changepoints in the first 80% of the data. Increase n_changepoints if trends shift frequently or set changepoint_prior_scale higher to make the trend more flexible.

Holidays and events: Create a DataFrame with holiday dates and effects. Prophet treats these as one-time or recurring events that shift the baseline.

External regressors: Add extra columns as covariates when external factors drive the series—prices, promotions, weather conditions.

Cross-validation: Use Prophet's built-in time series cross-validation to evaluate forecast accuracy at different horizons and tune parameters systematically.


Command Palette

Search for a command to run...

Schnellzugriffe
STRG + KSuche
STRG + DNachtmodus / Tagmodus
STRG + LSprache ändern

Software-Details
Kompiliert vor etwa 13 Stunden
Release: v4.0.0-production
Buildnummer: master@27db988
Historie: 34 Items