Learn R Programming

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

prophet (version 0.2.1)

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

11,972

Version

0.2.1

License

BSD_3_clause + file LICENSE

Maintainer

Sean Taylor

Last Published

November 8th, 2017

Functions in prophet (0.2.1)

plot_forecast_component

Plot a particular component of the forecast.
make_holiday_features

Construct a matrix of holiday features.
predict.prophet

Predict using the prophet model.
simulated_historical_forecasts

Simulated historical forecasts.
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.
make_future_dataframe

Make dataframe with future dates for forecasting.
sample_posterior_predictive

Prophet posterior predictive samples.
predict_seasonal_components

Predict seasonality components, holidays, and added regressors.
prophet_copy

Copy Prophet object.
plot_seasonality

Plot a custom seasonal component.
get_prophet_stan_model

Load compiled Stan model
make_all_seasonality_features

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

Convert date vector
time_diff

Time difference between datetimes
sample_model

Simulate observations from the extrapolated generative model.
set_auto_seasonalities

Set seasonalities that were left on auto.
initialize_scales_fn

Initialize model scales.
seasonality_plot_df

Prepare dataframe for plotting seasonal components.
setup_dataframe

Prepare dataframe for fitting or predicting.
set_changepoints

Set changepoints
make_seasonality_features

Data frame with seasonality features.
plot.prophet

Plot the prophet forecast.
piecewise_logistic

Evaluate the piecewise logistic function.
predictive_samples

Sample from the posterior predictive distribution.
prophet

Prophet forecaster.
validate_column_name

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

Validates the inputs to Prophet.
fit.prophet

Fit the prophet model.
add_regressor

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

Gets changepoint matrix for history dataframe.
generate_cutoffs

Generate cutoff dates
fourier_series

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

Cross-validation for time series.
add_seasonality

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

Merge history and forecast for plotting.
add_group_component

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

Initialize logistic growth.
compile_stan_model

Compile Stan model
linear_growth_init

Initialize linear growth.
predict_trend

Predict trend using the prophet model.
parse_seasonality_args

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

Evaluate the piecewise linear function.
plot_weekly

Plot the weekly component of the forecast.
predict_uncertainty

Prophet uncertainty intervals for yhat and trend
sample_predictive_trend

Simulate the trend using the extrapolated generative model.
plot_yearly

Plot the yearly component of the forecast.