Learn R Programming

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

prophet (version 0.2)

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 and weekly seasonality, plus holidays. It works best with daily periodicity data with at least one year of historical data. Prophet is robust to missing data, shifts in the trend, and large outliers.

Copy Link

Version

Install

install.packages('prophet')

Monthly Downloads

13,019

Version

0.2

License

BSD_3_clause + file LICENSE

Maintainer

Sean Taylor

Last Published

September 12th, 2017

Functions in prophet (0.2)

cross_validation

Cross-validation for time series.
df_for_plotting

Merge history and forecast for plotting.
fit.prophet

Fit the prophet model.
fourier_series

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

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

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

Construct a matrix of holiday features.
make_seasonality_features

Data frame with seasonality features.
predict.prophet

Predict using the prophet model.
predict_seasonal_components

Predict seasonality components, holidays, and added regressors.
add_seasonality

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

Compile Stan model
get_prophet_stan_model

Load compiled Stan model
initialize_scales_fn

Initialize model scales.
parse_seasonality_args

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

Evaluate the piecewise linear function.
piecewise_logistic

Evaluate the piecewise logistic function.
plot.prophet

Plot the prophet forecast.
prophet_copy

Copy Prophet object.
plot_weekly

Plot the weekly component of the forecast.
plot_yearly

Plot the yearly component of the forecast.
predictive_samples

Sample from the posterior predictive distribution.
prophet

Prophet forecaster.
prophet_plot_components

Plot the components of a prophet forecast. Prints a ggplot2 with panels for trend, weekly and yearly seasonalities if present, and holidays if present.
set_date

Convert date vector
setup_dataframe

Prepare dataframe for fitting or predicting.
make_all_seasonality_features

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

Make dataframe with future dates for forecasting.
plot_forecast_component

Plot a particular component of the forecast.
plot_seasonality

Plot a custom seasonal component.
generate_cutoffs

Generate cutoff dates
get_changepoint_matrix

Gets changepoint matrix for history dataframe.
linear_growth_init

Initialize linear growth.
logistic_growth_init

Initialize logistic growth.
predict_trend

Predict trend using the prophet model.
set_auto_seasonalities

Set seasonalities that were left on auto.
set_changepoints

Set changepoints
sample_predictive_trend

Simulate the trend using the extrapolated generative model.
seasonality_plot_df

Prepare dataframe for plotting seasonal components.
validate_column_name

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

Validates the inputs to Prophet.
simulated_historical_forecasts

Simulated historical forecasts.
time_diff

Time difference between datetimes
predict_uncertainty

Prophet uncertainty intervals for yhat and trend
sample_model

Simulate observations from the extrapolated generative model.
sample_posterior_predictive

Prophet posterior predictive samples.