Learn R Programming

prophet (version 1.1.7)

Automatic Forecasting Procedure

Description

Implements a procedure for forecasting time series data based on an additive model where non-linear trends are fit with yearly, weekly, and daily seasonality, plus holiday effects. It works best with time series that have strong seasonal effects and several seasons of historical data. Prophet is robust to missing data and shifts in the trend, and typically handles outliers well.

Copy Link

Version

Install

install.packages('prophet')

Monthly Downloads

13,019

Version

1.1.7

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Cuong Duong

Last Published

January 22nd, 2026

Functions in prophet (1.1.7)

get_holiday_names

Return all possible holiday names of given country
mse

Mean squared error
plot_yearly

Plot the yearly component of the forecast.
predict.prophet

Predict using the prophet model.
performance_metrics

Compute performance metrics from cross-validation results.
make_future_dataframe

Make dataframe with future dates for forecasting.
.fit

Obtain the point estimates of the parameters of the Prophet model using stan's optimization algorithms.
make_holiday_features

Construct a matrix of holiday features.
.load_model

Load the Prophet Stan model.
piecewise_linear

Evaluate the piecewise linear function.
regressor_column_matrix

Dataframe indicating which columns of the feature matrix correspond to which seasonality/regressor components.
plot_weekly

Plot the weekly component of the forecast.
sample_model

Simulate observations from the extrapolated generative model.
sample_posterior_predictive

Prophet posterior predictive samples.
plot_seasonality

Plot a custom seasonal component.
get_stan_backend

Get the stan backend defined in the environment variables.
parse_seasonality_args

Get number of Fourier components for built-in seasonalities.
set_changepoints

Set changepoints
set_auto_seasonalities

Set seasonalities that were left on auto.
validate_inputs

Validates the inputs to Prophet.
rmse

Root mean squared error
piecewise_logistic

Evaluate the piecewise logistic function.
initialize_scales_fn

Initialize model scales.
plot_forecast_component

Plot a particular component of the forecast.
plot_cross_validation_metric

Plot a performance metric vs. forecast horizon from cross validation. Cross validation produces a collection of out-of-sample model predictions that can be compared to actual values, at a range of different horizons (distance from the cutoff). This computes a specified performance metric for each prediction, and aggregated over a rolling window with horizon.
prophet_plot_components

Plot the components of a prophet forecast. Prints a ggplot2 with whichever are available of: trend, holidays, weekly seasonality, yearly seasonality, and additive and multiplicative extra regressors.
regressor_coefficients

Summarise the coefficients of the extra regressors used in the model. For additive regressors, the coefficient represents the incremental impact on y of a unit increase in the regressor. For multiplicative regressors, the incremental impact is equal to trend(t) multiplied by the coefficient.
make_seasonality_features

Data frame with seasonality features.
make_holidays_df

Make dataframe of holidays for given years and countries
time_diff

Time difference between datetimes
plot.prophet

Plot the prophet forecast.
set_date

Convert date vector
setup_dataframe

Prepare dataframe for fitting or predicting.
predict_seasonal_components

Predict seasonality components, holidays, and added regressors.
predict_trend

Predict trend using the prophet model.
rolling_median_by_h

Compute a rolling median of x, after first aggregating by h
validate_column_name

Validates the name of a seasonality, holiday, or regressor.
smape

Symmetric mean absolute percentage error based on Chen and Yang (2004) formula
rolling_mean_by_h

Compute a rolling mean of x, after first aggregating by h
single_cutoff_forecast

Forecast for a single cutoff. Used in cross_validation function when evaluating for multiple cutoffs.
.stan_args

Gives Stan arguments the appropriate names depending on the chosen Stan backend.
mdape

Median absolute percent error
.sampling

Obtain the joint posterior distribution of the parameters of the Prophet model using MCMC sampling.
predictive_samples

Sample from the posterior predictive distribution.
prophet

Prophet forecaster.
prophet_copy

Copy Prophet object.
logistic_growth_init

Initialize logistic growth.
predict_uncertainty

Prophet uncertainty intervals for yhat and trend
mape

Mean absolute percent error
seasonality_plot_df

Prepare dataframe for plotting seasonal components.
linear_growth_init

Initialize constant growth.
sample_predictive_trend

Simulate the trend using the extrapolated generative model.
add_regressor

Add an additional regressor to be used for fitting and predicting.
add_group_component

Adds a component with given name that contains all of the components in group.
construct_holiday_dataframe

Construct a dataframe of holiday dates.
add_country_holidays

Add in built-in holidays for the specified country.
add_seasonality

Add a seasonal component with specified period, number of Fourier components, and prior scale.
cross_validation

Cross-validation for time series.
add_changepoints_to_plot

Get layers to overlay significant changepoints on prophet forecast plot.
dyplot.prophet

Plot the prophet forecast.
fit.prophet

Fit the prophet model.
df_for_plotting

Merge history and forecast for plotting.
mae

Mean absolute error
coverage

Coverage
flat_trend

Evaluate the flat trend function.
fourier_series

Provides Fourier series components with the specified frequency and order.
make_all_seasonality_features

Dataframe with seasonality features. Includes seasonality features, holiday features, and added regressors.
flat_growth_init

Initialize flat growth.
generated_holidays

Generated table of holiday dates at the country level from 1995 to 2045
generate_cutoffs

Generate cutoff dates
check_cmdstanr

Check that the required packages for using the cmdstanr backend are installed.