Learn R Programming

⚠️There's a newer version (1.0) of this package.Take me there.

prophet (version 0.5)

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

12,438

Version

0.5

License

BSD_3_clause + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Sean Taylor

Last Published

May 14th, 2019

Functions in prophet (0.5)

add_changepoints_to_plot

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

Sample from the posterior predictive distribution.
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.
generate_cutoffs

Generate cutoff dates
piecewise_logistic

Evaluate the piecewise logistic function.
predict_uncertainty

Prophet uncertainty intervals for yhat and trend
predict_trend

Predict trend using the prophet model.
set_changepoints

Set changepoints
fourier_series

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

Evaluate the piecewise linear function.
dyplot.prophet

Plot the prophet forecast.
performance_metrics

Compute performance metrics from cross-validation results.
make_future_dataframe

Make dataframe with future dates for forecasting.
construct_holiday_dataframe

Construct a dataframe of holiday dates.
make_holiday_features

Construct a matrix of holiday features.
coverage

Coverage
linear_growth_init

Initialize linear growth.
logistic_growth_init

Initialize logistic growth.
set_date

Convert date vector
plot_weekly

Plot the weekly component of the forecast.
prophet

Prophet forecaster.
sample_posterior_predictive

Prophet posterior predictive samples.
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.
sample_predictive_trend

Simulate the trend using the extrapolated generative model.
plot.prophet

Plot the prophet forecast.
rolling_mean_by_h

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

Simulate observations from the extrapolated generative model.
plot_yearly

Plot the yearly component of the forecast.
fit.prophet

Fit the prophet model.
mape

Mean absolute percent error
regressor_column_matrix

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

Root mean squared error
df_for_plotting

Merge history and forecast for plotting.
plot_forecast_component

Plot a particular component of the forecast.
mse

Mean squared error
plot_seasonality

Plot a custom seasonal component.
setup_dataframe

Prepare dataframe for fitting or predicting.
time_diff

Time difference between datetimes
get_prophet_stan_model

Load compiled Stan model
initialize_scales_fn

Initialize model scales.
predict.prophet

Predict using the prophet model.
make_holidays_df

Make dataframe of holidays for given years and countries
make_seasonality_features

Data frame with seasonality features.
validate_column_name

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

Validates the inputs to Prophet.
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.
prophet_copy

Copy Prophet object.
predict_seasonal_components

Predict seasonality components, holidays, and added regressors.
seasonality_plot_df

Prepare dataframe for plotting seasonal components.
set_auto_seasonalities

Set seasonalities that were left on auto.
cross_validation

Cross-validation for time series.
add_seasonality

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

Compile Stan model
generated_holidays

holidays table
add_country_holidays

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

Return all possible holiday names of given country
parse_seasonality_args

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

Mean absolute error
make_all_seasonality_features

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