Time Series Forecasting with Prophet: An High Level mini-Guide and Optimization Tips

Rahul S
4 min readMay 14, 2023

Prophet is a time series forecasting library developed by Facebook. It is designed to provide an easy-to-use and intuitive framework for forecasting time series data.

HIGH LEVEL OVERVIEW

The underlying model in Prophet combines trend estimation, seasonality modeling, and holiday effects to capture various components of the time series.

1. Trend Estimation:
Prophet starts by estimating the overall trend in the time series. It models the trend as a non-linear function that can be either logistic, growth or piecewise linear. The trend captures the long-term behavior and direction of the time series.

2. Seasonality Modeling:
Prophet accounts for seasonal patterns in the data. It identifies recurring patterns, such as weekly, monthly, or yearly seasonality, and incorporates them into the forecasting model. Prophet uses Fourier series to model seasonality, which allows it to capture both short-term and long-term seasonal effects.

3. Holiday Effects:
Prophet can handle holiday effects, which are often present in time series data. It allows you to specify custom holidays and their impact on the time series. Prophet includes these holidays as additional components in the model to improve the accuracy of the forecasts during holiday periods.

4. Handling of Outliers and Missing Data:
Prophet is designed to be robust to outliers and missing data. It can handle outliers by fitting them with a piecewise linear model. For missing data, Prophet applies imputation techniques to fill in the gaps based on the estimated trend and seasonality.

5. Forecasting:
Once the model is trained, Prophet can generate forecasts for a specified number of future periods. It provides point estimates of the expected values (yhat) as well as uncertainty intervals (yhat_lower and yhat_upper) that quantify the forecast uncertainty.

6. Visualization and Evaluation:
Prophet offers convenient methods for visualizing the forecast results. It provides built-in plotting functions to visualize the trend…

--

--