├── .deepsource.toml ├── .gitattributes ├── .github └── workflows │ ├── build-and-test.yml │ └── wheel.yml ├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── Dockerfile ├── LICENSE ├── Makefile ├── R ├── .Rbuildignore ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── R │ ├── data.R │ ├── diagnostics.R │ ├── make_holidays.R │ ├── plot.R │ ├── prophet.R │ ├── stan_backends.R │ ├── stanmodels.R │ ├── sysdata.rda │ ├── utilities.R │ └── zzz.R ├── configure ├── configure.win ├── data-raw │ ├── generated_holidays.R │ └── generated_holidays.csv ├── inst │ ├── include │ │ └── stan_meta_header.hpp │ └── stan │ │ └── prophet.stan ├── man │ ├── add_changepoints_to_plot.Rd │ ├── add_country_holidays.Rd │ ├── add_group_component.Rd │ ├── add_regressor.Rd │ ├── add_seasonality.Rd │ ├── check_cmdstanr.Rd │ ├── construct_holiday_dataframe.Rd │ ├── coverage.Rd │ ├── cross_validation.Rd │ ├── df_for_plotting.Rd │ ├── dot-fit.Rd │ ├── dot-load_model.Rd │ ├── dot-sampling.Rd │ ├── dot-stan_args.Rd │ ├── dyplot.prophet.Rd │ ├── fit.prophet.Rd │ ├── flat_growth_init.Rd │ ├── flat_trend.Rd │ ├── fourier_series.Rd │ ├── generate_cutoffs.Rd │ ├── generated_holidays.Rd │ ├── get_holiday_names.Rd │ ├── get_stan_backend.Rd │ ├── initialize_scales_fn.Rd │ ├── linear_growth_init.Rd │ ├── logistic_growth_init.Rd │ ├── mae.Rd │ ├── make_all_seasonality_features.Rd │ ├── make_future_dataframe.Rd │ ├── make_holiday_features.Rd │ ├── make_holidays_df.Rd │ ├── make_seasonality_features.Rd │ ├── mape.Rd │ ├── mdape.Rd │ ├── mse.Rd │ ├── parse_seasonality_args.Rd │ ├── performance_metrics.Rd │ ├── piecewise_linear.Rd │ ├── piecewise_logistic.Rd │ ├── plot.prophet.Rd │ ├── plot_cross_validation_metric.Rd │ ├── plot_forecast_component.Rd │ ├── plot_seasonality.Rd │ ├── plot_weekly.Rd │ ├── plot_yearly.Rd │ ├── predict.prophet.Rd │ ├── predict_seasonal_components.Rd │ ├── predict_trend.Rd │ ├── predict_uncertainty.Rd │ ├── predictive_samples.Rd │ ├── prophet.Rd │ ├── prophet_copy.Rd │ ├── prophet_plot_components.Rd │ ├── regressor_coefficients.Rd │ ├── regressor_column_matrix.Rd │ ├── rmse.Rd │ ├── rolling_mean_by_h.Rd │ ├── rolling_median_by_h.Rd │ ├── sample_model.Rd │ ├── sample_posterior_predictive.Rd │ ├── sample_predictive_trend.Rd │ ├── seasonality_plot_df.Rd │ ├── set_auto_seasonalities.Rd │ ├── set_changepoints.Rd │ ├── set_date.Rd │ ├── setup_dataframe.Rd │ ├── single_cutoff_forecast.Rd │ ├── smape.Rd │ ├── time_diff.Rd │ ├── validate_column_name.Rd │ └── validate_inputs.Rd ├── prophet.Rproj ├── src │ ├── Makevars │ └── Makevars.win ├── tests │ ├── testthat.R │ └── testthat │ │ ├── data.csv │ │ ├── data2.csv │ │ ├── test_diagnostics.R │ │ ├── test_prophet.R │ │ ├── test_stan_functions.R │ │ └── test_utilities.R └── vignettes │ └── quick_start.Rmd ├── README.md ├── docker-compose.yml ├── docs ├── .gitignore ├── CONTRIBUTING.md ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── Makefile ├── README.md ├── _config.yml ├── _data │ ├── authors.yml │ ├── features.yml │ ├── nav.yml │ ├── nav_docs.yml │ ├── powered_by.yml │ ├── powered_by_highlight.yml │ └── promo.yml ├── _docs │ ├── additional_topics.md │ ├── contributing.md │ ├── diagnostics.md │ ├── handling_shocks.md │ ├── holiday_effects.md │ ├── installation.md │ ├── multiplicative_seasonality.md │ ├── non-daily_data.md │ ├── outliers.md │ ├── quick_start.md │ ├── saturating_forecasts.md │ ├── seasonality,_holiday_effects,_and_regressors.md │ ├── trend_changepoints.md │ └── uncertainty_intervals.md ├── _includes │ ├── blog_pagination.html │ ├── content │ │ ├── gridblocks.html │ │ └── items │ │ │ └── gridblock.html │ ├── doc.html │ ├── doc_paging.html │ ├── footer.html │ ├── head.html │ ├── header.html │ ├── hero.html │ ├── home_header.html │ ├── katex_import.html │ ├── katex_render.html │ ├── nav.html │ ├── nav │ │ ├── collection_nav.html │ │ ├── collection_nav_group.html │ │ ├── collection_nav_group_item.html │ │ └── header_nav.html │ ├── nav_search.html │ ├── plugins │ │ ├── all_share.html │ │ ├── ascii_cinema.html │ │ ├── button.html │ │ ├── github_star.html │ │ ├── github_watch.html │ │ ├── google_share.html │ │ ├── iframe.html │ │ ├── like_button.html │ │ ├── plugin_row.html │ │ ├── post_social_plugins.html │ │ ├── slideshow.html │ │ ├── twitter_follow.html │ │ └── twitter_share.html │ ├── post.html │ ├── powered_by.html │ ├── social_plugins.html │ └── ui │ │ └── button.html ├── _layouts │ ├── basic.html │ ├── blog.html │ ├── blog_default.html │ ├── default.html │ ├── doc_default.html │ ├── doc_page.html │ ├── docs.html │ ├── home.html │ ├── page.html │ ├── plain.html │ ├── post.html │ ├── redirect.html │ └── top-level.html ├── _sass │ ├── _base.scss │ ├── _blog.scss │ ├── _buttons.scss │ ├── _footer.scss │ ├── _gridBlock.scss │ ├── _header.scss │ ├── _poweredby.scss │ ├── _promo.scss │ ├── _react_docs_nav.scss │ ├── _react_header_nav.scss │ ├── _reset.scss │ ├── _search.scss │ ├── _slideshow.scss │ ├── _syntax-highlighting.scss │ └── _tables.scss ├── blog │ ├── all.html │ └── index.html ├── css │ └── main.scss ├── docs │ └── index.html ├── feed.xml ├── index.md ├── nbconvert_template.tpl └── static │ ├── additional_topics_files │ ├── additional_topics_16_0.png │ ├── additional_topics_17_0.png │ ├── additional_topics_18_0.png │ ├── additional_topics_28_0.png │ └── additional_topics_29_0.png │ ├── diagnostics_files │ ├── diagnostics_17_0.png │ ├── diagnostics_18_0.png │ └── diagnostics_4_0.png │ ├── favicon.png │ ├── fonts │ ├── LatoLatin-Black.woff │ ├── LatoLatin-Black.woff2 │ ├── LatoLatin-BlackItalic.woff │ ├── LatoLatin-BlackItalic.woff2 │ ├── LatoLatin-Italic.woff │ ├── LatoLatin-Italic.woff2 │ ├── LatoLatin-Light.woff │ ├── LatoLatin-Light.woff2 │ ├── LatoLatin-Regular.woff │ └── LatoLatin-Regular.woff2 │ ├── handling_shocks_files │ ├── handling_shocks_15_0.png │ ├── handling_shocks_16_0.png │ ├── handling_shocks_18_0.png │ ├── handling_shocks_22_0.png │ ├── handling_shocks_34_0.png │ ├── handling_shocks_35_0.png │ ├── handling_shocks_4_0.png │ ├── handling_shocks_8_0.png │ └── handling_shocks_9_0.png │ ├── holiday_effects_files │ ├── holiday_effects_12_0.png │ └── holiday_effects_13_0.png │ ├── images │ ├── after-scrolling-down-example.png │ ├── android.svg │ ├── apple.svg │ ├── facebook.png │ ├── instagram.png │ └── landing-page-example.png │ ├── logo.svg │ ├── multiplicative_seasonality_files │ ├── multiplicative_seasonality_10_0.png │ ├── multiplicative_seasonality_3_1.png │ ├── multiplicative_seasonality_4_0.png │ ├── multiplicative_seasonality_6_1.png │ ├── multiplicative_seasonality_7_0.png │ └── multiplicative_seasonality_9_0.png │ ├── non-daily_data_files │ ├── non-daily_data_10_0.png │ ├── non-daily_data_12_0.png │ ├── non-daily_data_13_0.png │ ├── non-daily_data_15_1.png │ ├── non-daily_data_16_0.png │ ├── non-daily_data_18_2.png │ ├── non-daily_data_19_1.png │ ├── non-daily_data_21_0.png │ ├── non-daily_data_22_0.png │ ├── non-daily_data_3_1.png │ ├── non-daily_data_4_0.png │ ├── non-daily_data_6_0.png │ ├── non-daily_data_7_0.png │ └── non-daily_data_9_1.png │ ├── og_image.png │ ├── oss_logo.png │ ├── outliers_files │ ├── outliers_10_0.png │ ├── outliers_12_1.png │ ├── outliers_13_0.png │ ├── outliers_3_1.png │ ├── outliers_4_0.png │ ├── outliers_6_1.png │ ├── outliers_7_0.png │ └── outliers_9_1.png │ ├── prophet_paper_20170113.pdf │ ├── prophet_paper_preprint.pdf │ ├── quick_start_files │ ├── quick_start_12_0.png │ ├── quick_start_14_0.png │ ├── quick_start_30_0.png │ └── quick_start_32_0.png │ ├── saturating_forecasts_files │ ├── saturating_forecasts_12_0.png │ ├── saturating_forecasts_13_0.png │ ├── saturating_forecasts_15_1.png │ └── saturating_forecasts_16_0.png │ ├── seasonality,_holiday_effects,_and_regressors_files │ ├── seasonality,_holiday_effects,_and_regressors_13_0.png │ ├── seasonality,_holiday_effects,_and_regressors_14_0.png │ ├── seasonality,_holiday_effects,_and_regressors_23_0.png │ ├── seasonality,_holiday_effects,_and_regressors_24_0.png │ ├── seasonality,_holiday_effects,_and_regressors_29_1.png │ ├── seasonality,_holiday_effects,_and_regressors_30_0.png │ ├── seasonality,_holiday_effects,_and_regressors_32_1.png │ ├── seasonality,_holiday_effects,_and_regressors_33_0.png │ ├── seasonality,_holiday_effects,_and_regressors_35_1.png │ ├── seasonality,_holiday_effects,_and_regressors_36_0.png │ ├── seasonality,_holiday_effects,_and_regressors_41_1.png │ ├── seasonality,_holiday_effects,_and_regressors_42_0.png │ ├── seasonality,_holiday_effects,_and_regressors_51_1.png │ └── seasonality,_holiday_effects,_and_regressors_52_0.png │ ├── trend_changepoints_files │ ├── trend_changepoints_12_1.png │ ├── trend_changepoints_13_0.png │ ├── trend_changepoints_15_1.png │ ├── trend_changepoints_16_0.png │ ├── trend_changepoints_20_1.png │ ├── trend_changepoints_21_0.png │ ├── trend_changepoints_4_0.png │ ├── trend_changepoints_6_0.png │ ├── trend_changepoints_8_0.png │ └── trend_changepoints_9_0.png │ ├── uncertainty_intervals_files │ ├── uncertainty_intervals_10_0.png │ └── uncertainty_intervals_11_0.png │ └── wordmark.svg ├── examples ├── example_air_passengers.csv ├── example_pedestrians_covid.csv ├── example_pedestrians_multivariate.csv ├── example_retail_sales.csv ├── example_wp_log_R.csv ├── example_wp_log_R_outliers1.csv ├── example_wp_log_R_outliers2.csv ├── example_wp_log_peyton_manning.csv └── example_yosemite_temps.csv ├── notebooks ├── additional_topics.ipynb ├── diagnostics.ipynb ├── handling_shocks.ipynb ├── multiplicative_seasonality.ipynb ├── non-daily_data.ipynb ├── outliers.ipynb ├── quick_start.ipynb ├── saturating_forecasts.ipynb ├── seasonality,_holiday_effects,_and_regressors.ipynb ├── trend_changepoints.ipynb └── uncertainty_intervals.ipynb ├── python ├── LICENSE ├── MANIFEST.in ├── README.md ├── prophet │ ├── __init__.py │ ├── __version__.py │ ├── diagnostics.py │ ├── forecaster.py │ ├── make_holidays.py │ ├── models.py │ ├── plot.py │ ├── serialize.py │ ├── tests │ │ ├── __init__.py │ │ ├── conftest.py │ │ ├── data.csv │ │ ├── data2.csv │ │ ├── data3.csv │ │ ├── serialized_model_v0.6.1.dev0.json │ │ ├── serialized_model_v0.7.1.json │ │ ├── serialized_model_v1.0.1.json │ │ ├── test_diagnostics.py │ │ ├── test_prophet.py │ │ ├── test_serialize.py │ │ └── test_utilities.py │ └── utilities.py ├── pyproject.toml ├── scripts │ └── generate_holidays_file.py ├── setup.py └── stan │ └── prophet.stan └── python_shim ├── LICENSE ├── MANIFEST.in ├── README.md ├── fbprophet ├── __init__.py ├── diagnostics.py ├── forecaster.py ├── make_holidays.py ├── models.py ├── plot.py ├── serialize.py └── tests │ ├── __init__.py │ ├── data.csv │ └── test_package.py ├── requirements.txt └── setup.py /.deepsource.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | test_patterns = ["python/prophet/tests/**"] 4 | exclude_patterns = ["R/**", "notebooks/**", "docs/**", "examples/**"] 5 | 6 | [[analyzers]] 7 | name = "python" 8 | enabled = true 9 | 10 | [analyzers.meta] 11 | runtime_version = "3.x.x" 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | docs/* linguist-documentation 2 | examples/* linguist-documentation 3 | notebooks/* linguist-documentation 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled python modules. 2 | *.pyc 3 | 4 | # Persisted models. 5 | *.pkl 6 | 7 | # Setuptools distribution folder. 8 | python/dist/ 9 | python_shim/dist/ 10 | 11 | # test cache 12 | .pytest_cache 13 | python/prophet/tests/dask-worker-space 14 | 15 | # Python cache 16 | __pycache__ 17 | 18 | # Python egg metadata, regenerated from source files by setuptools. 19 | python/*.egg-info 20 | python/build/ 21 | python_shim/*.egg-info 22 | python_shim/build/ 23 | 24 | # Notebook checkpoints 25 | .ipynb_checkpoints 26 | 27 | *.*~ 28 | 29 | *.idea 30 | *.vscode 31 | *.DS_Store 32 | *.envrc 33 | 34 | # Development with Python 35 | python/**/bin/ 36 | python/**/etc/ 37 | python/**/lib/ 38 | python/**/lib64 39 | python/**/pyvenv.cfg 40 | python/**/share/ 41 | python/**/stan_model/ 42 | .Rproj.user 43 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: xenial 2 | addons: 3 | apt: 4 | packages: 5 | - libv8-dev 6 | language: python 7 | 8 | jobs: 9 | include: 10 | - language: python 11 | python: 12 | - "3.7" 13 | cache: pip 14 | install: 15 | - pip install --upgrade pip 16 | - pip install -U -r python/requirements.txt dask[dataframe] distributed 17 | script: 18 | - cd python && python setup.py develop test 19 | - python setup.py clean 20 | - rm -rf prophet/stan_model 21 | - wget https://github.com/stan-dev/cmdstan/releases/download/v2.22.1/cmdstan-2.22.1.tar.gz -O /tmp/cmdstan.tar.gz > /dev/null 22 | - tar -xvf /tmp/cmdstan.tar.gz -C /tmp > /dev/null 23 | - make -C /tmp/cmdstan-2.22.1/ build > /dev/null 24 | - CMDSTAN=/tmp/cmdstan-2.22.1 STAN_BACKEND=CMDSTANPY python setup.py develop test 25 | 26 | - language: r 27 | r: 28 | - devel 29 | cache: packages 30 | install: 31 | - R -e 'install.packages("devtools")' 32 | - R -e 'devtools::install_deps("R", dependencies = TRUE)' 33 | - cd R 34 | - R CMD build . 35 | - R CMD INSTALL *tar.gz 36 | script: 37 | - R -e 'library(prophet); library(devtools); devtools::test()' 38 | 39 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.fb.com/codeofconduct) so that you can understand what actions will and will not be tolerated. -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.7-stretch 2 | 3 | RUN apt-get -y install libc-dev 4 | 5 | RUN pip install --upgrade pip 6 | 7 | COPY . . 8 | 9 | WORKDIR python 10 | 11 | RUN python -m pip install -e ".[dev, parallel]" 12 | 13 | WORKDIR / 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Facebook, Inc. and its affiliates. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | docker-compose build 3 | 4 | py-shell: 5 | docker-compose run package ipython 6 | 7 | shell: 8 | docker-compose run package bash 9 | -------------------------------------------------------------------------------- /R/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^renv$ 2 | ^renv\.lock$ 3 | ^data-raw$ 4 | ^libs$ 5 | ^doc$ 6 | ^Meta$ 7 | ^.*\.Rproj$ 8 | ^\.Rproj\.user$ 9 | -------------------------------------------------------------------------------- /R/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # History files 4 | .Rhistory 5 | .Rapp.history 6 | 7 | # Session Data files 8 | .RData 9 | 10 | # User-specific files 11 | .Ruserdata 12 | 13 | # Example code in package build process 14 | *-Ex.R 15 | 16 | # Output files from R CMD build 17 | /*.tar.gz 18 | 19 | # Output files from R CMD check 20 | /*.Rcheck/ 21 | 22 | # RStudio files 23 | .Rproj.user/ 24 | 25 | # produced vignettes 26 | vignettes/*.html 27 | vignettes/*.pdf 28 | 29 | # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 30 | .httr-oauth 31 | 32 | # knitr and R markdown default cache directories 33 | *_cache/ 34 | /cache/ 35 | 36 | # Temporary files created by R markdown 37 | *.utf8.md 38 | *.knit.md 39 | 40 | # R Environment Variables 41 | .Renviron 42 | inst/doc 43 | 44 | # Stan 45 | exec/*.rda 46 | src/*.o 47 | src/*.h 48 | src/*.cc 49 | src/*.cpp 50 | src/*.hpp 51 | src/prophet.so 52 | src/prophet.dll 53 | src/init.o 54 | 55 | # Development 56 | .Rprofile 57 | renv.lock 58 | renv/ 59 | -------------------------------------------------------------------------------- /R/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: prophet 2 | Title: Automatic Forecasting Procedure 3 | Version: 1.1.6 4 | Date: 2024-09-29 5 | Authors@R: c( 6 | person("Sean", "Taylor", email = "sjtz@pm.me", role = c("cre", "aut")), 7 | person("Ben", "Letham", email = "bletham@fb.com", role = "aut") 8 | ) 9 | Description: Implements a procedure for forecasting time series data based on 10 | an additive model where non-linear trends are fit with yearly, weekly, and 11 | daily seasonality, plus holiday effects. It works best with time series 12 | that have strong seasonal effects and several seasons of historical data. 13 | Prophet is robust to missing data and shifts in the trend, and typically 14 | handles outliers well. 15 | URL: https://github.com/facebook/prophet 16 | BugReports: https://github.com/facebook/prophet/issues 17 | Depends: 18 | R (>= 3.4.0), 19 | Rcpp (>= 0.12.0), 20 | rlang (>= 0.3.0.1) 21 | Imports: 22 | dplyr (>= 0.7.7), 23 | dygraphs (>= 1.1.1.4), 24 | extraDistr, 25 | ggplot2, 26 | grid, 27 | lubridate, 28 | methods, 29 | RcppParallel (>= 5.0.1), 30 | rstan (>= 2.18.1), 31 | rstantools (>= 2.0.0), 32 | scales, 33 | StanHeaders, 34 | stats, 35 | tidyr (>= 0.6.1), 36 | xts 37 | Suggests: 38 | cmdstanr, 39 | posterior, 40 | knitr, 41 | testthat, 42 | readr, 43 | rmarkdown 44 | SystemRequirements: GNU make, C++11 45 | Biarch: true 46 | License: MIT + file LICENSE 47 | LinkingTo: 48 | BH (>= 1.66.0), 49 | Rcpp (>= 0.12.0), 50 | RcppParallel (>= 5.0.1), 51 | RcppEigen (>= 0.3.3.3.0), 52 | rstan (>= 2.18.1), 53 | StanHeaders (>= 2.18.0) 54 | LazyData: true 55 | VignetteBuilder: knitr 56 | Encoding: UTF-8 57 | RoxygenNote: 7.2.0 58 | -------------------------------------------------------------------------------- /R/LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2017-present 2 | COPYRIGHT HOLDER: Facebook, Inc. 3 | -------------------------------------------------------------------------------- /R/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method(plot,prophet) 4 | S3method(predict,prophet) 5 | export(add_changepoints_to_plot) 6 | export(add_country_holidays) 7 | export(add_regressor) 8 | export(add_seasonality) 9 | export(cross_validation) 10 | export(dyplot.prophet) 11 | export(fit.prophet) 12 | export(generated_holidays) 13 | export(make_future_dataframe) 14 | export(performance_metrics) 15 | export(plot_cross_validation_metric) 16 | export(plot_forecast_component) 17 | export(predictive_samples) 18 | export(prophet) 19 | export(prophet_plot_components) 20 | export(regressor_coefficients) 21 | import(Rcpp) 22 | import(RcppParallel, except = LdFlags) 23 | import(rlang) 24 | importFrom(dplyr,"%>%") 25 | useDynLib(prophet, .registration = TRUE) 26 | -------------------------------------------------------------------------------- /R/R/data.R: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | 7 | #' Generated table of holiday dates at the country level from 1995 to 2045 8 | #' 9 | #' The data is primarily based on the Python package [holidays](https://pypi.org/project/holidays/) 10 | #' 11 | #' @format A data frame with four variables: ds, holiday, country, year 12 | #' @source \url{https://github.com/facebook/prophet/blob/main/python/scripts/generate_holidays_file.py} 13 | #' @export 14 | "generated_holidays" 15 | -------------------------------------------------------------------------------- /R/R/make_holidays.R: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | 7 | #' Return all possible holiday names of given country 8 | #' 9 | #' @param country.name Country name (character). 10 | #' 11 | #' @return A vector of all possible holiday names (unique) of given country. 12 | #' @keywords internal 13 | get_holiday_names <- function(country.name){ 14 | holidays <- generated_holidays %>% 15 | dplyr::filter(country == country.name) %>% 16 | dplyr::select(holiday) %>% 17 | unique() 18 | return(holidays$holiday) 19 | } 20 | 21 | 22 | #' Make dataframe of holidays for given years and countries 23 | #' 24 | #' @param years List of years for which to include holiday dates. 25 | #' @param country.name Country name (character). 26 | #' 27 | #' @return Dataframe with 'ds' and 'holiday', which can directly feed 28 | #' to 'holidays' params in Prophet 29 | #' @keywords internal 30 | make_holidays_df <- function(years, country.name){ 31 | country.holidays = generated_holidays %>% 32 | dplyr::filter(country == country.name) 33 | max.year <- max(country.holidays$year) 34 | min.year <- min(country.holidays$year) 35 | if (max(years) > max.year || min(years) < min.year){ 36 | warning.msg = paste("Holidays for", country.name, "are only supported from", min.year, 37 | "to", max.year) 38 | warning(warning.msg) 39 | } 40 | holidays.df <- country.holidays %>% 41 | dplyr::filter(year %in% years) %>% 42 | dplyr::select(ds, holiday) %>% 43 | dplyr::mutate(ds = as.Date(ds)) %>% 44 | data.frame 45 | return(holidays.df) 46 | } 47 | -------------------------------------------------------------------------------- /R/R/stanmodels.R: -------------------------------------------------------------------------------- 1 | # Generated by rstantools. Do not edit by hand. 2 | 3 | # names of stan models 4 | stanmodels <- c("prophet") 5 | 6 | # load each stan module 7 | Rcpp::loadModule("stan_fit4prophet_mod", what = TRUE) 8 | 9 | # instantiate each stanmodel object 10 | stanmodels <- sapply(stanmodels, function(model_name) { 11 | # create C++ code for stan model 12 | stan_file <- if(dir.exists("stan")) "stan" else file.path("inst", "stan") 13 | stan_file <- file.path(stan_file, paste0(model_name, ".stan")) 14 | stanfit <- rstan::stanc_builder(stan_file, 15 | allow_undefined = TRUE, 16 | obfuscate_model_name = FALSE) 17 | stanfit$model_cpp <- list(model_cppname = stanfit$model_name, 18 | model_cppcode = stanfit$cppcode) 19 | # create stanmodel object 20 | methods::new(Class = "stanmodel", 21 | model_name = stanfit$model_name, 22 | model_code = stanfit$model_code, 23 | model_cpp = stanfit$model_cpp, 24 | mk_cppmodule = function(x) get(paste0("rstantools_model_", model_name))) 25 | }) 26 | -------------------------------------------------------------------------------- /R/R/sysdata.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/R/R/sysdata.rda -------------------------------------------------------------------------------- /R/R/utilities.R: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | #' Summarise the coefficients of the extra regressors used in the model. 7 | #' For additive regressors, the coefficient represents the incremental impact 8 | #' on \code{y} of a unit increase in the regressor. For multiplicative regressors, 9 | #' the incremental impact is equal to \code{trend(t)} multiplied by the coefficient. 10 | #' 11 | #' Coefficients are measured on the original scale of the training data. 12 | #' 13 | #' @param m Prophet model object, after fitting. 14 | #' 15 | #' @return Dataframe with one row per regressor. 16 | #' @details Output dataframe columns: 17 | #' \itemize{ 18 | #' \item{regressor: Name of the regressor} 19 | #' \item{regressor_mode: Whether the regressor has an additive or multiplicative 20 | #' effect on \code{y}.} 21 | #' \item{center: The mean of the regressor if it was standardized. Otherwise 0.} 22 | #' \item{coef_lower: Lower bound for the coefficient, estimated from the MCMC samples. 23 | #' Only different to \code{coef} if \code{mcmc_samples > 0}. 24 | #' } 25 | #' \item{coef: Expected value of the coefficient.} 26 | #' \item{coef_upper: Upper bound for the coefficient, estimated from MCMC samples. 27 | #' Only to different to \code{coef} if \code{mcmc_samples > 0}. 28 | #' } 29 | #' } 30 | #' 31 | #' @export 32 | regressor_coefficients <- function(m){ 33 | if (length(m$extra_regressors) == 0) { 34 | stop("No extra regressors found.") 35 | } 36 | regr_names <- names(m$extra_regressors) 37 | regr_modes <- unlist(lapply(m$extra_regressors, function(x) x$mode)) 38 | regr_mus <- unlist(lapply(m$extra_regressors, function (x) x$mu)) 39 | regr_stds <- unlist(lapply(m$extra_regressors, function(x) x$std)) 40 | 41 | beta_indices <- which(m$train.component.cols[, regr_names, drop = FALSE] == 1, arr.ind = TRUE)[, "row"] 42 | betas <- m$params$beta[, beta_indices, drop = FALSE] 43 | # If regressor is additive, multiply by the scale factor to put coefficients on the original training data scale. 44 | y_scale_indicator <- matrix( 45 | data = ifelse(regr_modes == "additive", m$y.scale, 1), 46 | nrow = nrow(betas), 47 | ncol = ncol(betas), 48 | byrow = TRUE 49 | ) 50 | coefs <- betas * y_scale_indicator / regr_stds 51 | 52 | percentiles = c((1 - m$interval.width) / 2, 1 - (1 - m$interval.width) / 2) 53 | bounds <- apply(betas, 2, stats::quantile, probs = percentiles) 54 | 55 | df <- data.frame( 56 | regressor = regr_names, 57 | regressor_mode = regr_modes, 58 | center = regr_mus, 59 | coef_lower = bounds[1, ], 60 | coef = apply(betas, 2, mean), 61 | coef_upper = bounds[2, ], 62 | stringsAsFactors = FALSE, 63 | row.names = NULL 64 | ) 65 | 66 | return(df) 67 | } 68 | -------------------------------------------------------------------------------- /R/R/zzz.R: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | .onLoad <- function(libname, pkgname) { 7 | # Create environment for storing stan model 8 | assign("prophet_model_env", new.env(), parent.env(environment())) 9 | tryCatch({ 10 | if (.Platform$OS.type == "windows") { 11 | dest <- file.path('libs', .Platform$r_arch) 12 | } else { 13 | dest <- 'libs' 14 | } 15 | binary <- system.file( 16 | dest, 17 | 'prophet_stan_model.RData', 18 | package = 'prophet', 19 | mustWork = TRUE 20 | ) 21 | load(binary) 22 | obj.name <- 'model.stanm' 23 | stanm <- eval(parse(text = obj.name)) 24 | 25 | ## Should cause an error if the model doesn't work. 26 | stanm@mk_cppmodule(stanm) 27 | 28 | assign( 29 | ".prophet.stan.model", 30 | stanm, 31 | envir=prophet_model_env 32 | ) 33 | }, 34 | error = function(cond) {} 35 | ) 36 | } 37 | 38 | # IMPORTS ---- 39 | # StanHeaders - Used to prevent issues with Prophet dynload error 40 | 41 | #' @import StanHeaders 42 | -------------------------------------------------------------------------------- /R/configure: -------------------------------------------------------------------------------- 1 | # Generated by rstantools. Do not edit by hand. 2 | 3 | #! /bin/sh 4 | "${R_HOME}/bin/Rscript" -e "rstantools::rstan_config()" 5 | -------------------------------------------------------------------------------- /R/configure.win: -------------------------------------------------------------------------------- 1 | # Generated by rstantools. Do not edit by hand. 2 | 3 | #! /bin/sh 4 | "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "rstantools::rstan_config()" 5 | -------------------------------------------------------------------------------- /R/data-raw/generated_holidays.R: -------------------------------------------------------------------------------- 1 | ## Copyright (c) 2017-present, Facebook, Inc. 2 | ## All rights reserved. 3 | 4 | ## This source code is licensed under the BSD-style license found in the 5 | ## LICENSE file in the root directory of this source tree. An additional grant 6 | ## of patent rights can be found in the PATENTS file in the same directory. 7 | 8 | 9 | generated_holidays <- read.csv("data-raw/generated_holidays.csv") 10 | usethis::use_data(generated_holidays, overwrite = TRUE, internal = TRUE) 11 | -------------------------------------------------------------------------------- /R/inst/include/stan_meta_header.hpp: -------------------------------------------------------------------------------- 1 | // Insert all #include statements here 2 | -------------------------------------------------------------------------------- /R/man/add_changepoints_to_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{add_changepoints_to_plot} 4 | \alias{add_changepoints_to_plot} 5 | \title{Get layers to overlay significant changepoints on prophet forecast plot.} 6 | \usage{ 7 | add_changepoints_to_plot( 8 | m, 9 | threshold = 0.01, 10 | cp_color = "red", 11 | cp_linetype = "dashed", 12 | trend = TRUE, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{m}{Prophet model object.} 18 | 19 | \item{threshold}{Numeric, changepoints where abs(delta) >= threshold are 20 | significant. (Default 0.01)} 21 | 22 | \item{cp_color}{Character, line color. (Default "red")} 23 | 24 | \item{cp_linetype}{Character or integer, line type. (Default "dashed")} 25 | 26 | \item{trend}{Logical, if FALSE, do not draw trend line. (Default TRUE)} 27 | 28 | \item{...}{Other arguments passed on to layers.} 29 | } 30 | \value{ 31 | A list of ggplot2 layers. 32 | } 33 | \description{ 34 | Get layers to overlay significant changepoints on prophet forecast plot. 35 | } 36 | \examples{ 37 | \dontrun{ 38 | plot(m, fcst) + add_changepoints_to_plot(m) 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /R/man/add_country_holidays.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{add_country_holidays} 4 | \alias{add_country_holidays} 5 | \title{Add in built-in holidays for the specified country.} 6 | \usage{ 7 | add_country_holidays(m, country_name) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{country_name}{Name of the country, like 'UnitedStates' or 'US'} 13 | } 14 | \value{ 15 | The prophet model with the holidays country set. 16 | } 17 | \description{ 18 | These holidays will be included in addition to any specified on model 19 | initialization. 20 | } 21 | \details{ 22 | Holidays will be calculated for arbitrary date ranges in the history 23 | and future. See the online documentation for the list of countries with 24 | built-in holidays. 25 | 26 | Built-in country holidays can only be set for a single country. 27 | } 28 | -------------------------------------------------------------------------------- /R/man/add_group_component.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{add_group_component} 4 | \alias{add_group_component} 5 | \title{Adds a component with given name that contains all of the components 6 | in group.} 7 | \usage{ 8 | add_group_component(components, name, group) 9 | } 10 | \arguments{ 11 | \item{components}{Dataframe with components.} 12 | 13 | \item{name}{Name of new group component.} 14 | 15 | \item{group}{List of components that form the group.} 16 | } 17 | \value{ 18 | Dataframe with components. 19 | } 20 | \description{ 21 | Adds a component with given name that contains all of the components 22 | in group. 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /R/man/add_regressor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{add_regressor} 4 | \alias{add_regressor} 5 | \title{Add an additional regressor to be used for fitting and predicting.} 6 | \usage{ 7 | add_regressor(m, name, prior.scale = NULL, standardize = "auto", mode = NULL) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{name}{String name of the regressor} 13 | 14 | \item{prior.scale}{Float scale for the normal prior. If not provided, 15 | holidays.prior.scale will be used.} 16 | 17 | \item{standardize}{Bool, specify whether this regressor will be standardized 18 | prior to fitting. Can be 'auto' (standardize if not binary), True, or 19 | False.} 20 | 21 | \item{mode}{Optional, 'additive' or 'multiplicative'. Defaults to 22 | m$seasonality.mode.} 23 | } 24 | \value{ 25 | The prophet model with the regressor added. 26 | } 27 | \description{ 28 | The dataframe passed to `fit` and `predict` will have a column with the 29 | specified name to be used as a regressor. When standardize='auto', the 30 | regressor will be standardized unless it is binary. The regression 31 | coefficient is given a prior with the specified scale parameter. 32 | Decreasing the prior scale will add additional regularization. If no 33 | prior scale is provided, holidays.prior.scale will be used. 34 | Mode can be specified as either 'additive' or 'multiplicative'. If not 35 | specified, m$seasonality.mode will be used. 'additive' means the effect of 36 | the regressor will be added to the trend, 'multiplicative' means it will 37 | multiply the trend. 38 | } 39 | -------------------------------------------------------------------------------- /R/man/add_seasonality.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{add_seasonality} 4 | \alias{add_seasonality} 5 | \title{Add a seasonal component with specified period, number of Fourier 6 | components, and prior scale.} 7 | \usage{ 8 | add_seasonality( 9 | m, 10 | name, 11 | period, 12 | fourier.order, 13 | prior.scale = NULL, 14 | mode = NULL, 15 | condition.name = NULL 16 | ) 17 | } 18 | \arguments{ 19 | \item{m}{Prophet object.} 20 | 21 | \item{name}{String name of the seasonality component.} 22 | 23 | \item{period}{Float number of days in one period.} 24 | 25 | \item{fourier.order}{Int number of Fourier components to use.} 26 | 27 | \item{prior.scale}{Optional float prior scale for this component.} 28 | 29 | \item{mode}{Optional 'additive' or 'multiplicative'.} 30 | 31 | \item{condition.name}{String name of the seasonality condition.} 32 | } 33 | \value{ 34 | The prophet model with the seasonality added. 35 | } 36 | \description{ 37 | Increasing the number of Fourier components allows the seasonality to change 38 | more quickly (at risk of overfitting). Default values for yearly and weekly 39 | seasonalities are 10 and 3 respectively. 40 | } 41 | \details{ 42 | Increasing prior scale will allow this seasonality component more 43 | flexibility, decreasing will dampen it. If not provided, will use the 44 | seasonality.prior.scale provided on Prophet initialization (defaults to 10). 45 | 46 | Mode can be specified as either 'additive' or 'multiplicative'. If not 47 | specified, m$seasonality.mode will be used (defaults to 'additive'). 48 | Additive means the seasonality will be added to the trend, multiplicative 49 | means it will multiply the trend. 50 | 51 | If condition.name is provided, the dataframe passed to `fit` and `predict` 52 | should have a column with the specified condition.name containing booleans 53 | which decides when to apply seasonality. 54 | } 55 | -------------------------------------------------------------------------------- /R/man/check_cmdstanr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/stan_backends.R 3 | \name{check_cmdstanr} 4 | \alias{check_cmdstanr} 5 | \title{Check that the required packages for using the cmdstanr backend are installed.} 6 | \usage{ 7 | check_cmdstanr() 8 | } 9 | \value{ 10 | NULL if successful, and prints the current version of cmdstan being used. 11 | } 12 | \description{ 13 | Check that the required packages for using the cmdstanr backend are installed. 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /R/man/construct_holiday_dataframe.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{construct_holiday_dataframe} 4 | \alias{construct_holiday_dataframe} 5 | \title{Construct a dataframe of holiday dates.} 6 | \usage{ 7 | construct_holiday_dataframe(m, dates) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{dates}{Vector with dates used for computing seasonality.} 13 | } 14 | \value{ 15 | A dataframe of holiday dates, in holiday dataframe format used in 16 | initialization. 17 | } 18 | \description{ 19 | Construct a dataframe of holiday dates. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /R/man/coverage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{coverage} 4 | \alias{coverage} 5 | \title{Coverage} 6 | \usage{ 7 | coverage(df, w) 8 | } 9 | \arguments{ 10 | \item{df}{Cross-validation results dataframe.} 11 | 12 | \item{w}{Aggregation window size.} 13 | } 14 | \value{ 15 | Array of coverages 16 | } 17 | \description{ 18 | Coverage 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/cross_validation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{cross_validation} 4 | \alias{cross_validation} 5 | \title{Cross-validation for time series.} 6 | \usage{ 7 | cross_validation( 8 | model, 9 | horizon, 10 | units, 11 | period = NULL, 12 | initial = NULL, 13 | cutoffs = NULL 14 | ) 15 | } 16 | \arguments{ 17 | \item{model}{Fitted Prophet model.} 18 | 19 | \item{horizon}{Integer size of the horizon} 20 | 21 | \item{units}{String unit of the horizon, e.g., "days", "secs".} 22 | 23 | \item{period}{Integer amount of time between cutoff dates. Same units as 24 | horizon. If not provided, 0.5 * horizon is used.} 25 | 26 | \item{initial}{Integer size of the first training period. If not provided, 27 | 3 * horizon is used. Same units as horizon.} 28 | 29 | \item{cutoffs}{Vector of cutoff dates to be used during 30 | cross-validtation. If not provided works beginning from (end - horizon), 31 | works backwards making cutoffs with a spacing of period until initial is 32 | reached.} 33 | } 34 | \value{ 35 | A dataframe with the forecast, actual value, and cutoff date. 36 | } 37 | \description{ 38 | Computes forecasts from historical cutoff points which user can input.If 39 | not provided, these are computed beginning from (end - horizon), and working 40 | backwards making cutoffs with a spacing of period until initial is reached. 41 | } 42 | \details{ 43 | When period is equal to the time interval of the data, this is the 44 | technique described in https://robjhyndman.com/hyndsight/tscv/ . 45 | } 46 | -------------------------------------------------------------------------------- /R/man/df_for_plotting.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{df_for_plotting} 4 | \alias{df_for_plotting} 5 | \title{Merge history and forecast for plotting.} 6 | \usage{ 7 | df_for_plotting(m, fcst) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{fcst}{Data frame returned by prophet predict.} 13 | } 14 | \description{ 15 | Merge history and forecast for plotting. 16 | } 17 | \keyword{internal} 18 | -------------------------------------------------------------------------------- /R/man/dot-fit.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/stan_backends.R 3 | \name{.fit} 4 | \alias{.fit} 5 | \title{Obtain the point estimates of the parameters of the Prophet model using 6 | stan's optimization algorithms.} 7 | \usage{ 8 | .fit(args, backend) 9 | } 10 | \arguments{ 11 | \item{args}{Named list of arguments suitable for the chosen backend. Must 12 | include arguments required for optimization.} 13 | 14 | \item{backend}{"rstan" or "cmdstanr".} 15 | } 16 | \value{ 17 | A named list containing "stan_fit" (the fitted stan object), 18 | "params", and "n_iteration" 19 | } 20 | \description{ 21 | Obtain the point estimates of the parameters of the Prophet model using 22 | stan's optimization algorithms. 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /R/man/dot-load_model.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/stan_backends.R 3 | \name{.load_model} 4 | \alias{.load_model} 5 | \title{Load the Prophet Stan model.} 6 | \usage{ 7 | .load_model(backend) 8 | } 9 | \arguments{ 10 | \item{backend}{"rstan" or "cmdstanr".} 11 | } 12 | \value{ 13 | stanmodel object if backend = "rstan", CmdStanModel object if backend = "cmdstanr" 14 | } 15 | \description{ 16 | Load the Prophet Stan model. 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /R/man/dot-sampling.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/stan_backends.R 3 | \name{.sampling} 4 | \alias{.sampling} 5 | \title{Obtain the joint posterior distribution of the parameters of the Prophet 6 | model using MCMC sampling.} 7 | \usage{ 8 | .sampling(args, backend) 9 | } 10 | \arguments{ 11 | \item{args}{Named list of arguments suitable for the chosen backend. Must 12 | include arguments required for MCMC sampling.} 13 | 14 | \item{backend}{"rstan" or "cmdstanr".} 15 | } 16 | \value{ 17 | A named list containing "stan_fit" (the fitted stan object), 18 | "params", and "n_iteration" 19 | } 20 | \description{ 21 | Obtain the joint posterior distribution of the parameters of the Prophet 22 | model using MCMC sampling. 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /R/man/dot-stan_args.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/stan_backends.R 3 | \name{.stan_args} 4 | \alias{.stan_args} 5 | \title{Gives Stan arguments the appropriate names depending on the chosen Stan backend.} 6 | \usage{ 7 | .stan_args(model, dat, stan_init, backend, type, mcmc_samples = 0, ...) 8 | } 9 | \arguments{ 10 | \item{model}{Model object.} 11 | 12 | \item{dat}{List containing data to use in fitting.} 13 | 14 | \item{stan_init}{Function to initialize parameters for stan fit.} 15 | 16 | \item{backend}{"rstan" or "cmdstanr".} 17 | 18 | \item{type}{"mcmc" or "optimize".} 19 | 20 | \item{mcmc_samples}{Integer, if greater than 0, will do full Bayesian 21 | inference with the specified number of MCMC samples. If 0, will do MAP 22 | estimation.} 23 | } 24 | \value{ 25 | Named list of arguments. 26 | } 27 | \description{ 28 | Gives Stan arguments the appropriate names depending on the chosen Stan backend. 29 | } 30 | \keyword{internal} 31 | -------------------------------------------------------------------------------- /R/man/dyplot.prophet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{dyplot.prophet} 4 | \alias{dyplot.prophet} 5 | \title{Plot the prophet forecast.} 6 | \usage{ 7 | dyplot.prophet(x, fcst, uncertainty = TRUE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{Prophet object.} 11 | 12 | \item{fcst}{Data frame returned by predict(m, df).} 13 | 14 | \item{uncertainty}{Optional boolean indicating if the uncertainty interval for yhat 15 | should be plotted, which will only be done if x$uncertainty.samples > 0. Must be 16 | present in fcst as yhat_lower and yhat_upper.} 17 | 18 | \item{...}{additional arguments passed to dygraphs::dygraph} 19 | } 20 | \value{ 21 | A dygraph plot. 22 | } 23 | \description{ 24 | Plot the prophet forecast. 25 | } 26 | \examples{ 27 | \dontrun{ 28 | history <- data.frame( 29 | ds = seq(as.Date('2015-01-01'), as.Date('2016-01-01'), by = 'd'), 30 | y = sin(1:366/200) + rnorm(366)/10) 31 | m <- prophet(history) 32 | future <- make_future_dataframe(m, periods = 365) 33 | forecast <- predict(m, future) 34 | dyplot.prophet(m, forecast) 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /R/man/fit.prophet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{fit.prophet} 4 | \alias{fit.prophet} 5 | \title{Fit the prophet model.} 6 | \usage{ 7 | fit.prophet(m, df, ...) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{df}{Data frame.} 13 | 14 | \item{...}{Additional arguments passed to the \code{optimizing} or 15 | \code{sampling} functions in Stan.} 16 | } 17 | \description{ 18 | This sets m$params to contain the fitted model parameters. It is a list 19 | with the following elements: 20 | k (M array): M posterior samples of the initial slope. 21 | m (M array): The initial intercept. 22 | delta (MxN matrix): The slope change at each of N changepoints. 23 | beta (MxK matrix): Coefficients for K seasonality features. 24 | sigma_obs (M array): Noise level. 25 | Note that M=1 if MAP estimation. 26 | } 27 | -------------------------------------------------------------------------------- /R/man/flat_growth_init.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{flat_growth_init} 4 | \alias{flat_growth_init} 5 | \title{Initialize flat growth.} 6 | \usage{ 7 | flat_growth_init(df) 8 | } 9 | \arguments{ 10 | \item{df}{Data frame with columns ds (date), y_scaled (scaled time series), 11 | and t (scaled time).} 12 | } 13 | \value{ 14 | A vector (k, m) with the rate (k) and offset (m) of the flat 15 | growth function. 16 | } 17 | \description{ 18 | Provides a strong initialization for flat growth by setting the 19 | growth to 0 and calculates the offset parameter that pass the 20 | function through the mean of the the y_scaled values. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /R/man/flat_trend.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{flat_trend} 4 | \alias{flat_trend} 5 | \title{Evaluate the flat trend function.} 6 | \usage{ 7 | flat_trend(t, m) 8 | } 9 | \arguments{ 10 | \item{t}{Vector of times on which the function is evaluated.} 11 | 12 | \item{m}{Float initial offset.} 13 | } 14 | \value{ 15 | Vector y(t). 16 | } 17 | \description{ 18 | Evaluate the flat trend function. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/fourier_series.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{fourier_series} 4 | \alias{fourier_series} 5 | \title{Provides Fourier series components with the specified frequency and order.} 6 | \usage{ 7 | fourier_series(dates, period, series.order) 8 | } 9 | \arguments{ 10 | \item{dates}{Vector of dates.} 11 | 12 | \item{period}{Number of days of the period.} 13 | 14 | \item{series.order}{Number of components.} 15 | } 16 | \value{ 17 | Matrix with seasonality features. 18 | } 19 | \description{ 20 | Provides Fourier series components with the specified frequency and order. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /R/man/generate_cutoffs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{generate_cutoffs} 4 | \alias{generate_cutoffs} 5 | \title{Generate cutoff dates} 6 | \usage{ 7 | generate_cutoffs(df, horizon, initial, period) 8 | } 9 | \arguments{ 10 | \item{df}{Dataframe with historical data.} 11 | 12 | \item{horizon}{timediff forecast horizon.} 13 | 14 | \item{initial}{timediff initial window.} 15 | 16 | \item{period}{timediff Simulated forecasts are done with this period.} 17 | } 18 | \value{ 19 | Array of datetimes. 20 | } 21 | \description{ 22 | Generate cutoff dates 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /R/man/generated_holidays.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{generated_holidays} 5 | \alias{generated_holidays} 6 | \title{Generated table of holiday dates at the country level from 1995 to 2045} 7 | \format{ 8 | A data frame with four variables: ds, holiday, country, year 9 | } 10 | \source{ 11 | \url{https://github.com/facebook/prophet/blob/main/python/scripts/generate_holidays_file.py} 12 | } 13 | \usage{ 14 | generated_holidays 15 | } 16 | \description{ 17 | The data is primarily based on the Python package [holidays](https://pypi.org/project/holidays/) 18 | } 19 | \keyword{datasets} 20 | -------------------------------------------------------------------------------- /R/man/get_holiday_names.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/make_holidays.R 3 | \name{get_holiday_names} 4 | \alias{get_holiday_names} 5 | \title{Return all possible holiday names of given country} 6 | \usage{ 7 | get_holiday_names(country.name) 8 | } 9 | \arguments{ 10 | \item{country.name}{Country name (character).} 11 | } 12 | \value{ 13 | A vector of all possible holiday names (unique) of given country. 14 | } 15 | \description{ 16 | Return all possible holiday names of given country 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /R/man/get_stan_backend.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/stan_backends.R 3 | \name{get_stan_backend} 4 | \alias{get_stan_backend} 5 | \title{Get the stan backend defined in the environment variables.} 6 | \usage{ 7 | get_stan_backend() 8 | } 9 | \value{ 10 | 'rstan' or 'cmdstanr'. 'rstan' if variable is not set. 11 | } 12 | \description{ 13 | Get the stan backend defined in the environment variables. 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /R/man/initialize_scales_fn.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{initialize_scales_fn} 4 | \alias{initialize_scales_fn} 5 | \title{Initialize model scales.} 6 | \usage{ 7 | initialize_scales_fn(m, initialize_scales, df) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{initialize_scales}{Boolean set the scales or not.} 13 | 14 | \item{df}{Dataframe for setting scales.} 15 | } 16 | \value{ 17 | Prophet object with scales set. 18 | } 19 | \description{ 20 | Sets model scaling factors using df. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /R/man/linear_growth_init.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{linear_growth_init} 4 | \alias{linear_growth_init} 5 | \title{Initialize constant growth.} 6 | \usage{ 7 | linear_growth_init(df) 8 | } 9 | \arguments{ 10 | \item{df}{Data frame with columns ds (date), y_scaled (scaled time series), 11 | and t (scaled time).} 12 | } 13 | \value{ 14 | A vector (k, m) with the rate (k) and offset (m) of the linear 15 | growth function. 16 | } 17 | \description{ 18 | Provides a strong initialization for linear growth by calculating the 19 | growth and offset parameters that pass the function through the first and 20 | last points in the time series. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /R/man/logistic_growth_init.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{logistic_growth_init} 4 | \alias{logistic_growth_init} 5 | \title{Initialize logistic growth.} 6 | \usage{ 7 | logistic_growth_init(df) 8 | } 9 | \arguments{ 10 | \item{df}{Data frame with columns ds (date), cap_scaled (scaled capacity), 11 | y_scaled (scaled time series), and t (scaled time).} 12 | } 13 | \value{ 14 | A vector (k, m) with the rate (k) and offset (m) of the logistic 15 | growth function. 16 | } 17 | \description{ 18 | Provides a strong initialization for logistic growth by calculating the 19 | growth and offset parameters that pass the function through the first and 20 | last points in the time series. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /R/man/mae.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{mae} 4 | \alias{mae} 5 | \title{Mean absolute error} 6 | \usage{ 7 | mae(df, w) 8 | } 9 | \arguments{ 10 | \item{df}{Cross-validation results dataframe.} 11 | 12 | \item{w}{Aggregation window size.} 13 | } 14 | \value{ 15 | Array of mean absolute errors. 16 | } 17 | \description{ 18 | Mean absolute error 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/make_all_seasonality_features.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{make_all_seasonality_features} 4 | \alias{make_all_seasonality_features} 5 | \title{Dataframe with seasonality features. 6 | Includes seasonality features, holiday features, and added regressors.} 7 | \usage{ 8 | make_all_seasonality_features(m, df) 9 | } 10 | \arguments{ 11 | \item{m}{Prophet object.} 12 | 13 | \item{df}{Dataframe with dates for computing seasonality features and any 14 | added regressors.} 15 | } 16 | \value{ 17 | List with items 18 | seasonal.features: Dataframe with regressor features, 19 | prior.scales: Array of prior scales for each column of the features 20 | dataframe. 21 | component.cols: Dataframe with indicators for which regression components 22 | correspond to which columns. 23 | modes: List with keys 'additive' and 'multiplicative' with arrays of 24 | component names for each mode of seasonality. 25 | } 26 | \description{ 27 | Dataframe with seasonality features. 28 | Includes seasonality features, holiday features, and added regressors. 29 | } 30 | \keyword{internal} 31 | -------------------------------------------------------------------------------- /R/man/make_future_dataframe.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{make_future_dataframe} 4 | \alias{make_future_dataframe} 5 | \title{Make dataframe with future dates for forecasting.} 6 | \usage{ 7 | make_future_dataframe(m, periods, freq = "day", include_history = TRUE) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet model object.} 11 | 12 | \item{periods}{Int number of periods to forecast forward.} 13 | 14 | \item{freq}{'day', 'week', 'month', 'quarter', 'year', 1(1 sec), 60(1 minute) or 3600(1 hour).} 15 | 16 | \item{include_history}{Boolean to include the historical dates in the data 17 | frame for predictions.} 18 | } 19 | \value{ 20 | Dataframe that extends forward from the end of m$history for the 21 | requested number of periods. 22 | } 23 | \description{ 24 | Make dataframe with future dates for forecasting. 25 | } 26 | -------------------------------------------------------------------------------- /R/man/make_holiday_features.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{make_holiday_features} 4 | \alias{make_holiday_features} 5 | \title{Construct a matrix of holiday features.} 6 | \usage{ 7 | make_holiday_features(m, dates, holidays) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{dates}{Vector with dates used for computing seasonality.} 13 | 14 | \item{holidays}{Dataframe containing holidays, as returned by 15 | construct_holiday_dataframe.} 16 | } 17 | \value{ 18 | A list with entries 19 | holiday.features: dataframe with a column for each holiday. 20 | prior.scales: array of prior scales for each holiday column. 21 | holiday.names: array of names of all holidays. 22 | } 23 | \description{ 24 | Construct a matrix of holiday features. 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /R/man/make_holidays_df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/make_holidays.R 3 | \name{make_holidays_df} 4 | \alias{make_holidays_df} 5 | \title{Make dataframe of holidays for given years and countries} 6 | \usage{ 7 | make_holidays_df(years, country.name) 8 | } 9 | \arguments{ 10 | \item{years}{List of years for which to include holiday dates.} 11 | 12 | \item{country.name}{Country name (character).} 13 | } 14 | \value{ 15 | Dataframe with 'ds' and 'holiday', which can directly feed 16 | to 'holidays' params in Prophet 17 | } 18 | \description{ 19 | Make dataframe of holidays for given years and countries 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /R/man/make_seasonality_features.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{make_seasonality_features} 4 | \alias{make_seasonality_features} 5 | \title{Data frame with seasonality features.} 6 | \usage{ 7 | make_seasonality_features(dates, period, series.order, prefix) 8 | } 9 | \arguments{ 10 | \item{dates}{Vector of dates.} 11 | 12 | \item{period}{Number of days of the period.} 13 | 14 | \item{series.order}{Number of components.} 15 | 16 | \item{prefix}{Column name prefix.} 17 | } 18 | \value{ 19 | Dataframe with seasonality. 20 | } 21 | \description{ 22 | Data frame with seasonality features. 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /R/man/mape.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{mape} 4 | \alias{mape} 5 | \title{Mean absolute percent error} 6 | \usage{ 7 | mape(df, w) 8 | } 9 | \arguments{ 10 | \item{df}{Cross-validation results dataframe.} 11 | 12 | \item{w}{Aggregation window size.} 13 | } 14 | \value{ 15 | Array of mean absolute percent errors. 16 | } 17 | \description{ 18 | Mean absolute percent error 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/mdape.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{mdape} 4 | \alias{mdape} 5 | \title{Median absolute percent error} 6 | \usage{ 7 | mdape(df, w) 8 | } 9 | \arguments{ 10 | \item{df}{Cross-validation results dataframe.} 11 | 12 | \item{w}{Aggregation window size.} 13 | } 14 | \value{ 15 | Array of median absolute percent errors. 16 | } 17 | \description{ 18 | Median absolute percent error 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/mse.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{mse} 4 | \alias{mse} 5 | \title{Mean squared error} 6 | \usage{ 7 | mse(df, w) 8 | } 9 | \arguments{ 10 | \item{df}{Cross-validation results dataframe.} 11 | 12 | \item{w}{Aggregation window size.} 13 | } 14 | \value{ 15 | Array of mean squared errors. 16 | } 17 | \description{ 18 | Mean squared error 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/parse_seasonality_args.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{parse_seasonality_args} 4 | \alias{parse_seasonality_args} 5 | \title{Get number of Fourier components for built-in seasonalities.} 6 | \usage{ 7 | parse_seasonality_args(m, name, arg, auto.disable, default.order) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{name}{String name of the seasonality component.} 13 | 14 | \item{arg}{'auto', TRUE, FALSE, or number of Fourier components as 15 | provided.} 16 | 17 | \item{auto.disable}{Bool if seasonality should be disabled when 'auto'.} 18 | 19 | \item{default.order}{Int default Fourier order.} 20 | } 21 | \value{ 22 | Number of Fourier components, or 0 for disabled. 23 | } 24 | \description{ 25 | Get number of Fourier components for built-in seasonalities. 26 | } 27 | \keyword{internal} 28 | -------------------------------------------------------------------------------- /R/man/performance_metrics.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{performance_metrics} 4 | \alias{performance_metrics} 5 | \title{Compute performance metrics from cross-validation results.} 6 | \usage{ 7 | performance_metrics(df, metrics = NULL, rolling_window = 0.1) 8 | } 9 | \arguments{ 10 | \item{df}{The dataframe returned by cross_validation.} 11 | 12 | \item{metrics}{An array of performance metrics to compute. If not provided, 13 | will use c('mse', 'rmse', 'mae', 'mape', 'mdape', 'smape', 'coverage').} 14 | 15 | \item{rolling_window}{Proportion of data to use in each rolling window for 16 | computing the metrics. Should be in [0, 1] to average.} 17 | } 18 | \value{ 19 | A dataframe with a column for each metric, and column 'horizon'. 20 | } 21 | \description{ 22 | Computes a suite of performance metrics on the output of cross-validation. 23 | By default the following metrics are included: 24 | 'mse': mean squared error, 25 | 'rmse': root mean squared error, 26 | 'mae': mean absolute error, 27 | 'mape': mean percent error, 28 | 'mdape': median percent error, 29 | 'smape': symmetric mean absolute percentage error, 30 | 'coverage': coverage of the upper and lower intervals 31 | } 32 | \details{ 33 | A subset of these can be specified by passing a list of names as the 34 | `metrics` argument. 35 | 36 | Metrics are calculated over a rolling window of cross validation 37 | predictions, after sorting by horizon. Averaging is first done within each 38 | value of the horizon, and then across horizons as needed to reach the 39 | window size. The size of that window (number of simulated forecast points) 40 | is determined by the rolling_window argument, which specifies a proportion 41 | of simulated forecast points to include in each window. rolling_window=0 42 | will compute it separately for each horizon. The default of 43 | rolling_window=0.1 will use 10% of the rows in df in each window. 44 | rolling_window=1 will compute the metric across all simulated forecast 45 | points. The results are set to the right edge of the window. 46 | 47 | If rolling_window < 0, then metrics are computed at each datapoint with no 48 | averaging (i.e., 'mse' will actually be squared error with no mean). 49 | 50 | The output is a dataframe containing column 'horizon' along with columns 51 | for each of the metrics computed. 52 | } 53 | -------------------------------------------------------------------------------- /R/man/piecewise_linear.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{piecewise_linear} 4 | \alias{piecewise_linear} 5 | \title{Evaluate the piecewise linear function.} 6 | \usage{ 7 | piecewise_linear(t, deltas, k, m, changepoint.ts) 8 | } 9 | \arguments{ 10 | \item{t}{Vector of times on which the function is evaluated.} 11 | 12 | \item{deltas}{Vector of rate changes at each changepoint.} 13 | 14 | \item{k}{Float initial rate.} 15 | 16 | \item{m}{Float initial offset.} 17 | 18 | \item{changepoint.ts}{Vector of changepoint times.} 19 | } 20 | \value{ 21 | Vector y(t). 22 | } 23 | \description{ 24 | Evaluate the piecewise linear function. 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /R/man/piecewise_logistic.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{piecewise_logistic} 4 | \alias{piecewise_logistic} 5 | \title{Evaluate the piecewise logistic function.} 6 | \usage{ 7 | piecewise_logistic(t, cap, deltas, k, m, changepoint.ts) 8 | } 9 | \arguments{ 10 | \item{t}{Vector of times on which the function is evaluated.} 11 | 12 | \item{cap}{Vector of capacities at each t.} 13 | 14 | \item{deltas}{Vector of rate changes at each changepoint.} 15 | 16 | \item{k}{Float initial rate.} 17 | 18 | \item{m}{Float initial offset.} 19 | 20 | \item{changepoint.ts}{Vector of changepoint times.} 21 | } 22 | \value{ 23 | Vector y(t). 24 | } 25 | \description{ 26 | Evaluate the piecewise logistic function. 27 | } 28 | \keyword{internal} 29 | -------------------------------------------------------------------------------- /R/man/plot.prophet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{plot.prophet} 4 | \alias{plot.prophet} 5 | \title{Plot the prophet forecast.} 6 | \usage{ 7 | \method{plot}{prophet}( 8 | x, 9 | fcst, 10 | uncertainty = TRUE, 11 | plot_cap = TRUE, 12 | xlabel = "ds", 13 | ylabel = "y", 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{Prophet object.} 19 | 20 | \item{fcst}{Data frame returned by predict(m, df).} 21 | 22 | \item{uncertainty}{Optional boolean indicating if the uncertainty interval for yhat 23 | should be plotted, which will only be done if x$uncertainty.samples > 0. 24 | Must be present in fcst as yhat_lower and yhat_upper.} 25 | 26 | \item{plot_cap}{Boolean indicating if the capacity should be shown in the 27 | figure, if available.} 28 | 29 | \item{xlabel}{Optional label for x-axis} 30 | 31 | \item{ylabel}{Optional label for y-axis} 32 | 33 | \item{...}{additional arguments} 34 | } 35 | \value{ 36 | A ggplot2 plot. 37 | } 38 | \description{ 39 | Plot the prophet forecast. 40 | } 41 | \examples{ 42 | \dontrun{ 43 | history <- data.frame(ds = seq(as.Date('2015-01-01'), as.Date('2016-01-01'), by = 'd'), 44 | y = sin(1:366/200) + rnorm(366)/10) 45 | m <- prophet(history) 46 | future <- make_future_dataframe(m, periods = 365) 47 | forecast <- predict(m, future) 48 | plot(m, forecast) 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /R/man/plot_cross_validation_metric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{plot_cross_validation_metric} 4 | \alias{plot_cross_validation_metric} 5 | \title{Plot a performance metric vs. forecast horizon from cross validation. 6 | Cross validation produces a collection of out-of-sample model predictions 7 | that can be compared to actual values, at a range of different horizons 8 | (distance from the cutoff). This computes a specified performance metric 9 | for each prediction, and aggregated over a rolling window with horizon.} 10 | \usage{ 11 | plot_cross_validation_metric(df_cv, metric, rolling_window = 0.1) 12 | } 13 | \arguments{ 14 | \item{df_cv}{The output from fbprophet.diagnostics.cross_validation.} 15 | 16 | \item{metric}{Metric name, one of 'mse', 'rmse', 'mae', 'mape', 'coverage'.} 17 | 18 | \item{rolling_window}{Proportion of data to use for rolling average of 19 | metric. In [0, 1]. Defaults to 0.1.} 20 | } 21 | \value{ 22 | A ggplot2 plot. 23 | } 24 | \description{ 25 | This uses fbprophet.diagnostics.performance_metrics to compute the metrics. 26 | Valid values of metric are 'mse', 'rmse', 'mae', 'mape', and 'coverage'. 27 | } 28 | \details{ 29 | rolling_window is the proportion of data included in the rolling window of 30 | aggregation. The default value of 0.1 means 10% of data are included in the 31 | aggregation for computing the metric. 32 | 33 | As a concrete example, if metric='mse', then this plot will show the 34 | squared error for each cross validation prediction, along with the MSE 35 | averaged over rolling windows of 10% of the data. 36 | } 37 | -------------------------------------------------------------------------------- /R/man/plot_forecast_component.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{plot_forecast_component} 4 | \alias{plot_forecast_component} 5 | \title{Plot a particular component of the forecast.} 6 | \usage{ 7 | plot_forecast_component(m, fcst, name, uncertainty = TRUE, plot_cap = FALSE) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet model} 11 | 12 | \item{fcst}{Dataframe output of `predict`.} 13 | 14 | \item{name}{String name of the component to plot (column of fcst).} 15 | 16 | \item{uncertainty}{Optional boolean to plot uncertainty intervals, which will 17 | only be done if m$uncertainty.samples > 0.} 18 | 19 | \item{plot_cap}{Boolean indicating if the capacity should be shown in the 20 | figure, if available.} 21 | } 22 | \value{ 23 | A ggplot2 plot. 24 | } 25 | \description{ 26 | Plot a particular component of the forecast. 27 | } 28 | -------------------------------------------------------------------------------- /R/man/plot_seasonality.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{plot_seasonality} 4 | \alias{plot_seasonality} 5 | \title{Plot a custom seasonal component.} 6 | \usage{ 7 | plot_seasonality(m, name, uncertainty = TRUE) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet model object.} 11 | 12 | \item{name}{String name of the seasonality.} 13 | 14 | \item{uncertainty}{Optional boolean to plot uncertainty intervals, which 15 | will only be done if m$uncertainty.samples > 0.} 16 | } 17 | \value{ 18 | A ggplot2 plot. 19 | } 20 | \description{ 21 | Plot a custom seasonal component. 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /R/man/plot_weekly.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{plot_weekly} 4 | \alias{plot_weekly} 5 | \title{Plot the weekly component of the forecast.} 6 | \usage{ 7 | plot_weekly(m, uncertainty = TRUE, weekly_start = 0, name = "weekly") 8 | } 9 | \arguments{ 10 | \item{m}{Prophet model object} 11 | 12 | \item{uncertainty}{Optional boolean to plot uncertainty intervals, which will 13 | only be done if m$uncertainty.samples > 0.} 14 | 15 | \item{weekly_start}{Integer specifying the start day of the weekly 16 | seasonality plot. 0 (default) starts the week on Sunday. 1 shifts by 1 day 17 | to Monday, and so on.} 18 | 19 | \item{name}{Name of seasonality component if previously changed 20 | from default 'weekly'.} 21 | } 22 | \value{ 23 | A ggplot2 plot. 24 | } 25 | \description{ 26 | Plot the weekly component of the forecast. 27 | } 28 | \keyword{internal} 29 | -------------------------------------------------------------------------------- /R/man/plot_yearly.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{plot_yearly} 4 | \alias{plot_yearly} 5 | \title{Plot the yearly component of the forecast.} 6 | \usage{ 7 | plot_yearly(m, uncertainty = TRUE, yearly_start = 0, name = "yearly") 8 | } 9 | \arguments{ 10 | \item{m}{Prophet model object.} 11 | 12 | \item{uncertainty}{Optional boolean to plot uncertainty intervals, which 13 | will only be done if m$uncertainty.samples > 0.} 14 | 15 | \item{yearly_start}{Integer specifying the start day of the yearly 16 | seasonality plot. 0 (default) starts the year on Jan 1. 1 shifts by 1 day 17 | to Jan 2, and so on.} 18 | 19 | \item{name}{Name of seasonality component if previously changed 20 | from default 'yearly'.} 21 | } 22 | \value{ 23 | A ggplot2 plot. 24 | } 25 | \description{ 26 | Plot the yearly component of the forecast. 27 | } 28 | \keyword{internal} 29 | -------------------------------------------------------------------------------- /R/man/predict.prophet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{predict.prophet} 4 | \alias{predict.prophet} 5 | \title{Predict using the prophet model.} 6 | \usage{ 7 | \method{predict}{prophet}(object, df = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{object}{Prophet object.} 11 | 12 | \item{df}{Dataframe with dates for predictions (column ds), and capacity 13 | (column cap) if logistic growth. If not provided, predictions are made on 14 | the history.} 15 | 16 | \item{...}{additional arguments.} 17 | } 18 | \value{ 19 | A dataframe with the forecast components. 20 | } 21 | \description{ 22 | Predict using the prophet model. 23 | } 24 | \examples{ 25 | \dontrun{ 26 | history <- data.frame(ds = seq(as.Date('2015-01-01'), as.Date('2016-01-01'), by = 'd'), 27 | y = sin(1:366/200) + rnorm(366)/10) 28 | m <- prophet(history) 29 | future <- make_future_dataframe(m, periods = 365) 30 | forecast <- predict(m, future) 31 | plot(m, forecast) 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /R/man/predict_seasonal_components.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{predict_seasonal_components} 4 | \alias{predict_seasonal_components} 5 | \title{Predict seasonality components, holidays, and added regressors.} 6 | \usage{ 7 | predict_seasonal_components(m, df) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{df}{Prediction dataframe.} 13 | } 14 | \value{ 15 | Dataframe with seasonal components. 16 | } 17 | \description{ 18 | Predict seasonality components, holidays, and added regressors. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/predict_trend.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{predict_trend} 4 | \alias{predict_trend} 5 | \title{Predict trend using the prophet model.} 6 | \usage{ 7 | predict_trend(model, df) 8 | } 9 | \arguments{ 10 | \item{model}{Prophet object.} 11 | 12 | \item{df}{Prediction dataframe.} 13 | } 14 | \value{ 15 | Vector with trend on prediction dates. 16 | } 17 | \description{ 18 | Predict trend using the prophet model. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/predict_uncertainty.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{predict_uncertainty} 4 | \alias{predict_uncertainty} 5 | \title{Prophet uncertainty intervals for yhat and trend} 6 | \usage{ 7 | predict_uncertainty(m, df) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{df}{Prediction dataframe.} 13 | } 14 | \value{ 15 | Dataframe with uncertainty intervals. 16 | } 17 | \description{ 18 | Prophet uncertainty intervals for yhat and trend 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/predictive_samples.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{predictive_samples} 4 | \alias{predictive_samples} 5 | \title{Sample from the posterior predictive distribution.} 6 | \usage{ 7 | predictive_samples(m, df) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{df}{Dataframe with dates for predictions (column ds), and capacity 13 | (column cap) if logistic growth.} 14 | } 15 | \value{ 16 | A list with items "trend" and "yhat" containing 17 | posterior predictive samples for that component. 18 | } 19 | \description{ 20 | Sample from the posterior predictive distribution. 21 | } 22 | -------------------------------------------------------------------------------- /R/man/prophet_copy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{prophet_copy} 4 | \alias{prophet_copy} 5 | \title{Copy Prophet object.} 6 | \usage{ 7 | prophet_copy(m, cutoff = NULL) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet model object.} 11 | 12 | \item{cutoff}{Date, possibly as string. Changepoints are only retained if 13 | changepoints <= cutoff.} 14 | } 15 | \value{ 16 | An unfitted Prophet model object with the same parameters as the 17 | input model. 18 | } 19 | \description{ 20 | Copy Prophet object. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /R/man/prophet_plot_components.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{prophet_plot_components} 4 | \alias{prophet_plot_components} 5 | \title{Plot the components of a prophet forecast. 6 | Prints a ggplot2 with whichever are available of: trend, holidays, weekly 7 | seasonality, yearly seasonality, and additive and multiplicative extra 8 | regressors.} 9 | \usage{ 10 | prophet_plot_components( 11 | m, 12 | fcst, 13 | uncertainty = TRUE, 14 | plot_cap = TRUE, 15 | weekly_start = 0, 16 | yearly_start = 0, 17 | render_plot = TRUE 18 | ) 19 | } 20 | \arguments{ 21 | \item{m}{Prophet object.} 22 | 23 | \item{fcst}{Data frame returned by predict(m, df).} 24 | 25 | \item{uncertainty}{Optional boolean indicating if the uncertainty interval should be 26 | plotted for the trend, from fcst columns trend_lower and trend_upper.This will 27 | only be done if m$uncertainty.samples > 0.} 28 | 29 | \item{plot_cap}{Boolean indicating if the capacity should be shown in the 30 | figure, if available.} 31 | 32 | \item{weekly_start}{Integer specifying the start day of the weekly 33 | seasonality plot. 0 (default) starts the week on Sunday. 1 shifts by 1 day 34 | to Monday, and so on.} 35 | 36 | \item{yearly_start}{Integer specifying the start day of the yearly 37 | seasonality plot. 0 (default) starts the year on Jan 1. 1 shifts by 1 day 38 | to Jan 2, and so on.} 39 | 40 | \item{render_plot}{Boolean indicating if the plots should be rendered. 41 | Set to FALSE if you want the function to only return the list of panels.} 42 | } 43 | \value{ 44 | Invisibly return a list containing the plotted ggplot objects 45 | } 46 | \description{ 47 | Plot the components of a prophet forecast. 48 | Prints a ggplot2 with whichever are available of: trend, holidays, weekly 49 | seasonality, yearly seasonality, and additive and multiplicative extra 50 | regressors. 51 | } 52 | -------------------------------------------------------------------------------- /R/man/regressor_coefficients.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{regressor_coefficients} 4 | \alias{regressor_coefficients} 5 | \title{Summarise the coefficients of the extra regressors used in the model. 6 | For additive regressors, the coefficient represents the incremental impact 7 | on \code{y} of a unit increase in the regressor. For multiplicative regressors, 8 | the incremental impact is equal to \code{trend(t)} multiplied by the coefficient.} 9 | \usage{ 10 | regressor_coefficients(m) 11 | } 12 | \arguments{ 13 | \item{m}{Prophet model object, after fitting.} 14 | } 15 | \value{ 16 | Dataframe with one row per regressor. 17 | } 18 | \description{ 19 | Coefficients are measured on the original scale of the training data. 20 | } 21 | \details{ 22 | Output dataframe columns: 23 | \itemize{ 24 | \item{regressor: Name of the regressor} 25 | \item{regressor_mode: Whether the regressor has an additive or multiplicative 26 | effect on \code{y}.} 27 | \item{center: The mean of the regressor if it was standardized. Otherwise 0.} 28 | \item{coef_lower: Lower bound for the coefficient, estimated from the MCMC samples. 29 | Only different to \code{coef} if \code{mcmc_samples > 0}. 30 | } 31 | \item{coef: Expected value of the coefficient.} 32 | \item{coef_upper: Upper bound for the coefficient, estimated from MCMC samples. 33 | Only to different to \code{coef} if \code{mcmc_samples > 0}. 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /R/man/regressor_column_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{regressor_column_matrix} 4 | \alias{regressor_column_matrix} 5 | \title{Dataframe indicating which columns of the feature matrix correspond to 6 | which seasonality/regressor components.} 7 | \usage{ 8 | regressor_column_matrix(m, seasonal.features, modes) 9 | } 10 | \arguments{ 11 | \item{m}{Prophet object.} 12 | 13 | \item{seasonal.features}{Constructed seasonal features dataframe.} 14 | 15 | \item{modes}{List with keys 'additive' and 'multiplicative' with arrays of 16 | component names for each mode of seasonality.} 17 | } 18 | \value{ 19 | List with items 20 | component.cols: A binary indicator dataframe with columns seasonal 21 | components and rows columns in seasonal.features. Entry is 1 if that 22 | column is used in that component. 23 | modes: Updated input with combination components. 24 | } 25 | \description{ 26 | Includes combination components, like 'additive_terms'. These combination 27 | components will be added to the 'modes' input. 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /R/man/rmse.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{rmse} 4 | \alias{rmse} 5 | \title{Root mean squared error} 6 | \usage{ 7 | rmse(df, w) 8 | } 9 | \arguments{ 10 | \item{df}{Cross-validation results dataframe.} 11 | 12 | \item{w}{Aggregation window size.} 13 | } 14 | \value{ 15 | Array of root mean squared errors. 16 | } 17 | \description{ 18 | Root mean squared error 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/rolling_mean_by_h.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{rolling_mean_by_h} 4 | \alias{rolling_mean_by_h} 5 | \title{Compute a rolling mean of x, after first aggregating by h} 6 | \usage{ 7 | rolling_mean_by_h(x, h, w, name) 8 | } 9 | \arguments{ 10 | \item{x}{Array.} 11 | 12 | \item{h}{Array of horizon for each value in x.} 13 | 14 | \item{w}{Integer window size (number of elements).} 15 | 16 | \item{name}{String name for metric in result dataframe.} 17 | } 18 | \value{ 19 | Dataframe with columns horizon and name, the rolling mean of x. 20 | } 21 | \description{ 22 | Right-aligned. Computes a single mean for each unique value of h. Each mean 23 | is over at least w samples. 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /R/man/rolling_median_by_h.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{rolling_median_by_h} 4 | \alias{rolling_median_by_h} 5 | \title{Compute a rolling median of x, after first aggregating by h} 6 | \usage{ 7 | rolling_median_by_h(x, h, w, name) 8 | } 9 | \arguments{ 10 | \item{x}{Array.} 11 | 12 | \item{h}{Array of horizon for each value in x.} 13 | 14 | \item{w}{Integer window size (number of elements).} 15 | 16 | \item{name}{String name for metric in result dataframe.} 17 | } 18 | \value{ 19 | Dataframe with columns horizon and name, the rolling median of x. 20 | } 21 | \description{ 22 | Right-aligned. Computes a single median for each unique value of h. Each median 23 | is over at least w samples. 24 | } 25 | \details{ 26 | For each h where there are fewer than w samples, we take samples from the previous h, 27 | } 28 | -------------------------------------------------------------------------------- /R/man/sample_model.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{sample_model} 4 | \alias{sample_model} 5 | \title{Simulate observations from the extrapolated generative model.} 6 | \usage{ 7 | sample_model(m, df, seasonal.features, iteration, s_a, s_m) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{df}{Prediction dataframe.} 13 | 14 | \item{seasonal.features}{Data frame of seasonal features} 15 | 16 | \item{iteration}{Int sampling iteration to use parameters from.} 17 | 18 | \item{s_a}{Indicator vector for additive components} 19 | 20 | \item{s_m}{Indicator vector for multiplicative components} 21 | } 22 | \value{ 23 | List of trend and yhat, each a vector like df$t. 24 | } 25 | \description{ 26 | Simulate observations from the extrapolated generative model. 27 | } 28 | \keyword{internal} 29 | -------------------------------------------------------------------------------- /R/man/sample_posterior_predictive.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{sample_posterior_predictive} 4 | \alias{sample_posterior_predictive} 5 | \title{Prophet posterior predictive samples.} 6 | \usage{ 7 | sample_posterior_predictive(m, df) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{df}{Prediction dataframe.} 13 | } 14 | \value{ 15 | List with posterior predictive samples for the forecast yhat and 16 | for the trend component. 17 | } 18 | \description{ 19 | Prophet posterior predictive samples. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /R/man/sample_predictive_trend.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{sample_predictive_trend} 4 | \alias{sample_predictive_trend} 5 | \title{Simulate the trend using the extrapolated generative model.} 6 | \usage{ 7 | sample_predictive_trend(model, df, iteration) 8 | } 9 | \arguments{ 10 | \item{model}{Prophet object.} 11 | 12 | \item{df}{Prediction dataframe.} 13 | 14 | \item{iteration}{Int sampling iteration to use parameters from.} 15 | } 16 | \value{ 17 | Vector of simulated trend over df$t. 18 | } 19 | \description{ 20 | Simulate the trend using the extrapolated generative model. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /R/man/seasonality_plot_df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{seasonality_plot_df} 4 | \alias{seasonality_plot_df} 5 | \title{Prepare dataframe for plotting seasonal components.} 6 | \usage{ 7 | seasonality_plot_df(m, ds) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{ds}{Array of dates for column ds.} 13 | } 14 | \value{ 15 | A dataframe with seasonal components on ds. 16 | } 17 | \description{ 18 | Prepare dataframe for plotting seasonal components. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /R/man/set_auto_seasonalities.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{set_auto_seasonalities} 4 | \alias{set_auto_seasonalities} 5 | \title{Set seasonalities that were left on auto.} 6 | \usage{ 7 | set_auto_seasonalities(m) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | } 12 | \value{ 13 | The prophet model with seasonalities set. 14 | } 15 | \description{ 16 | Turns on yearly seasonality if there is >=2 years of history. 17 | Turns on weekly seasonality if there is >=2 weeks of history, and the 18 | spacing between dates in the history is <7 days. 19 | Turns on daily seasonality if there is >=2 days of history, and the spacing 20 | between dates in the history is <1 day. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /R/man/set_changepoints.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{set_changepoints} 4 | \alias{set_changepoints} 5 | \title{Set changepoints} 6 | \usage{ 7 | set_changepoints(m) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | } 12 | \value{ 13 | m with changepoints set. 14 | } 15 | \description{ 16 | Sets m$changepoints to the dates of changepoints. Either: 17 | 1) The changepoints were passed in explicitly. 18 | A) They are empty. 19 | B) They are not empty, and need validation. 20 | 2) We are generating a grid of them. 21 | 3) The user prefers no changepoints be used. 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /R/man/set_date.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{set_date} 4 | \alias{set_date} 5 | \title{Convert date vector} 6 | \usage{ 7 | set_date(ds) 8 | } 9 | \arguments{ 10 | \item{ds}{Date vector} 11 | } 12 | \value{ 13 | vector of POSIXct object converted from date 14 | } 15 | \description{ 16 | Convert the date to POSIXct object. Timezones are stripped and replaced 17 | with GMT. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /R/man/setup_dataframe.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{setup_dataframe} 4 | \alias{setup_dataframe} 5 | \title{Prepare dataframe for fitting or predicting.} 6 | \usage{ 7 | setup_dataframe(m, df, initialize_scales = FALSE) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | 12 | \item{df}{Data frame with columns ds, y, and cap if logistic growth. Any 13 | specified additional regressors must also be present.} 14 | 15 | \item{initialize_scales}{Boolean set scaling factors in m from df.} 16 | } 17 | \value{ 18 | list with items 'df' and 'm'. 19 | } 20 | \description{ 21 | Adds a time index and scales y. Creates auxiliary columns 't', 't_ix', 22 | 'y_scaled', and 'cap_scaled'. These columns are used during both fitting 23 | and predicting. 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /R/man/single_cutoff_forecast.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{single_cutoff_forecast} 4 | \alias{single_cutoff_forecast} 5 | \title{Forecast for a single cutoff. 6 | Used in cross_validation function when evaluating for multiple cutoffs.} 7 | \usage{ 8 | single_cutoff_forecast(df, model, cutoff, horizon.dt, predict_columns) 9 | } 10 | \arguments{ 11 | \item{df}{Dataframe with history for cutoff.} 12 | 13 | \item{model}{Prophet model object.} 14 | 15 | \item{cutoff}{Datetime of cutoff.} 16 | 17 | \item{horizon.dt}{timediff forecast horizon.} 18 | 19 | \item{predict_columns}{Array of names of columns to be returned in output.} 20 | } 21 | \value{ 22 | Dataframe with forecast, actual value, and cutoff. 23 | } 24 | \description{ 25 | Forecast for a single cutoff. 26 | Used in cross_validation function when evaluating for multiple cutoffs. 27 | } 28 | \keyword{internal} 29 | -------------------------------------------------------------------------------- /R/man/smape.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diagnostics.R 3 | \name{smape} 4 | \alias{smape} 5 | \title{Symmetric mean absolute percentage error 6 | based on Chen and Yang (2004) formula} 7 | \usage{ 8 | smape(df, w) 9 | } 10 | \arguments{ 11 | \item{df}{Cross-validation results dataframe.} 12 | 13 | \item{w}{Aggregation window size.} 14 | } 15 | \value{ 16 | Array of symmetric mean absolute percent errors. 17 | } 18 | \description{ 19 | Symmetric mean absolute percentage error 20 | based on Chen and Yang (2004) formula 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /R/man/time_diff.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{time_diff} 4 | \alias{time_diff} 5 | \title{Time difference between datetimes} 6 | \usage{ 7 | time_diff(ds1, ds2, units = "days") 8 | } 9 | \arguments{ 10 | \item{ds1}{POSIXct object} 11 | 12 | \item{ds2}{POSIXct object} 13 | 14 | \item{units}{string units of difference, e.g. 'days' or 'secs'.} 15 | } 16 | \value{ 17 | numeric time difference 18 | } 19 | \description{ 20 | Compute time difference of two POSIXct objects 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /R/man/validate_column_name.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{validate_column_name} 4 | \alias{validate_column_name} 5 | \title{Validates the name of a seasonality, holiday, or regressor.} 6 | \usage{ 7 | validate_column_name( 8 | m, 9 | name, 10 | check_holidays = TRUE, 11 | check_seasonalities = TRUE, 12 | check_regressors = TRUE 13 | ) 14 | } 15 | \arguments{ 16 | \item{m}{Prophet object.} 17 | 18 | \item{name}{string} 19 | 20 | \item{check_holidays}{bool check if name already used for holiday} 21 | 22 | \item{check_seasonalities}{bool check if name already used for seasonality} 23 | 24 | \item{check_regressors}{bool check if name already used for regressor} 25 | } 26 | \description{ 27 | Validates the name of a seasonality, holiday, or regressor. 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /R/man/validate_inputs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/prophet.R 3 | \name{validate_inputs} 4 | \alias{validate_inputs} 5 | \title{Validates the inputs to Prophet.} 6 | \usage{ 7 | validate_inputs(m) 8 | } 9 | \arguments{ 10 | \item{m}{Prophet object.} 11 | } 12 | \value{ 13 | The Prophet object. 14 | } 15 | \description{ 16 | Validates the inputs to Prophet. 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /R/prophet.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /R/src/Makevars: -------------------------------------------------------------------------------- 1 | # Generated by rstantools. Do not edit by hand. 2 | 3 | STANHEADERS_SRC = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "message()" -e "cat(system.file('include', 'src', package = 'StanHeaders', mustWork = TRUE))" -e "message()" | grep "StanHeaders") 4 | 5 | STANC_FLAGS = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "cat(ifelse(utils::packageVersion('rstan') >= 2.26, '-DUSE_STANC3',''))") 6 | PKG_CPPFLAGS = -I"../inst/include" -I"$(STANHEADERS_SRC)" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_MATH_OVERFLOW_ERROR_POLICY=errno_on_error $(STANC_FLAGS) 7 | PKG_CXXFLAGS = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "RcppParallel::CxxFlags()") $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "StanHeaders:::CxxFlags()") 8 | PKG_LIBS = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "RcppParallel::RcppParallelLibs()") $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "StanHeaders:::LdFlags()") 9 | 10 | CXX_STD = CXX14 11 | -------------------------------------------------------------------------------- /R/src/Makevars.win: -------------------------------------------------------------------------------- 1 | # Generated by rstantools. Do not edit by hand. 2 | 3 | STANHEADERS_SRC = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "message()" -e "cat(system.file('include', 'src', package = 'StanHeaders', mustWork = TRUE))" -e "message()" | grep "StanHeaders") 4 | 5 | STANC_FLAGS = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "cat(ifelse(utils::packageVersion('rstan') >= 2.26, '-DUSE_STANC3',''))") 6 | PKG_CPPFLAGS = -I"../inst/include" -I"$(STANHEADERS_SRC)" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DRCPP_PARALLEL_USE_TBB=1 $(STANC_FLAGS) 7 | PKG_CXXFLAGS = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "RcppParallel::CxxFlags()") $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "StanHeaders:::CxxFlags()") 8 | PKG_LIBS = $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "RcppParallel::RcppParallelLibs()") $(shell "$(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e "StanHeaders:::LdFlags()") 9 | 10 | CXX_STD = CXX14 11 | -------------------------------------------------------------------------------- /R/tests/testthat.R: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | Sys.setenv("R_TESTS" = "") 7 | library(testthat) 8 | library(prophet) 9 | 10 | test_check("prophet") 11 | -------------------------------------------------------------------------------- /R/tests/testthat/test_utilities.R: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | library(prophet) 7 | context("Prophet utilities tests") 8 | 9 | DATA <- read.csv('data.csv') 10 | DATA$ds <- as.Date(DATA$ds) 11 | 12 | build_model_with_regressors <- function(data, mcmc.samples = 0) { 13 | m <- prophet(mcmc.samples = mcmc.samples) 14 | m <- add_regressor(m, 'binary_feature', prior.scale=0.2) 15 | m <- add_regressor(m, 'numeric_feature', prior.scale=0.5) 16 | m <- add_regressor( 17 | m, 'numeric_feature2', prior.scale=0.5, mode = 'multiplicative') 18 | m <- add_regressor(m, 'binary_feature2', standardize=TRUE) 19 | 20 | df <- data 21 | df$binary_feature <- c(rep(0, 255), rep(1, 255)) 22 | df$numeric_feature <- 0:509 23 | df$numeric_feature2 <- 0:509 24 | df$binary_feature2 <- c(rep(1, 100), rep(0, 410)) 25 | m <- fit.prophet(m, df) 26 | 27 | return(m) 28 | } 29 | 30 | test_that("regressor_coefficients_no_uncertainty", { 31 | skip_if_not(Sys.getenv('R_ARCH') != '/i386') 32 | m <- build_model_with_regressors(DATA, mcmc.samples = 0) 33 | coefs <- regressor_coefficients(m) 34 | 35 | expect_equal(dim(coefs), c(4, 6)) 36 | expect_equal(coefs[, "coef_lower"], coefs[, "coef"]) 37 | expect_equal(coefs[, "coef_upper"], coefs[, "coef"]) 38 | }) 39 | 40 | test_that("regressor_coefficients_with_uncertainty", { 41 | skip_if_not(Sys.getenv('R_ARCH') != '/i386') 42 | suppressWarnings(m <- build_model_with_regressors(DATA, mcmc.samples = 100)) 43 | coefs <- regressor_coefficients(m) 44 | 45 | expect_equal(dim(coefs), c(4, 6)) 46 | expect_true(all(coefs[, "coef_lower"] < coefs[, "coef"])) 47 | expect_true(all(coefs[, "coef_upper"] > coefs[, "coef"])) 48 | }) 49 | -------------------------------------------------------------------------------- /R/vignettes/quick_start.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Quick Start Guide to Using Prophet" 3 | author: "Sean J. Taylor and Ben Letham" 4 | date: "`r Sys.Date()`" 5 | output: rmarkdown::html_vignette 6 | vignette: > 7 | %\VignetteIndexEntry{Quick Start Guide to Using Prophet} 8 | %\VignetteEngine{knitr::rmarkdown} 9 | \usepackage[utf8]{inputenc} 10 | --- 11 | 12 | ```{r, echo = FALSE, message = FALSE} 13 | knitr::opts_chunk$set(collapse = T, comment = "#>") 14 | options(tibble.print_min = 4L, tibble.print_max = 4L) 15 | library(prophet) 16 | library(dplyr) 17 | ``` 18 | 19 | This document provides a very brief introduction to the Prophet API. For a detailed guide on using Prophet, please visit the main site at [https://facebook.github.io/prophet/](https://facebook.github.io/prophet/). 20 | 21 | Prophet uses the normal model fitting API. We provide a `prophet` function that performs fitting and returns a model object. You can then call `predict` and `plot` on this model object. 22 | 23 | First we read in the data and create the outcome variable. 24 | 25 | ```{r, results= "hide"} 26 | library(readr) 27 | df <- read_csv('../tests/testthat/data.csv') 28 | ``` 29 | 30 | We call the `prophet` function to fit the model. The first argument is the historical dataframe. Additional arguments control how Prophet fits the data. 31 | 32 | ```{r} 33 | m <- prophet(df) 34 | ``` 35 | We need to construct a dataframe for prediction. The `make_future_dataframe` function takes the model object and a number of periods to forecast: 36 | 37 | ```{r} 38 | future <- make_future_dataframe(m, periods = 365) 39 | head(future) 40 | ``` 41 | As with most modeling procedures in R, we use the generic `predict` function to get our forecast: 42 | 43 | ```{r} 44 | forecast <- predict(m, future) 45 | head(forecast) 46 | ``` 47 | 48 | You can use the generic `plot` function to plot the forecast, but you must also pass the model in to be plotted: 49 | 50 | ```{r} 51 | plot(m, forecast) 52 | ``` 53 | 54 | You can plot the components of the forecast using the `prophet_plot_components` function: 55 | 56 | ```{r} 57 | prophet_plot_components(m, forecast) 58 | ``` 59 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | package: 4 | image: facebook/prophet 5 | build: 6 | context: . 7 | dockerfile: Dockerfile 8 | 9 | volumes: 10 | - .:/usr/src/app 11 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_STORE 2 | _site/ 3 | *.swo 4 | *.swp 5 | _site 6 | .sass-cache 7 | *.psd 8 | *~ 9 | .jekyll-metadata 10 | -------------------------------------------------------------------------------- /docs/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'github-pages', group: :jekyll_plugins 4 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | notebooks: 2 | for f in ../notebooks/*.ipynb; \ 3 | do \ 4 | NAME=$$(basename $$f .ipynb); \ 5 | jupyter nbconvert --to markdown ../notebooks/$$NAME.ipynb --template=nbconvert_template.tpl; \ 6 | mv -f ../notebooks/"$$NAME".md _docs/; \ 7 | rm -rf static/"$$NAME"_files; \ 8 | mv ../notebooks/"$$NAME"_files static/; \ 9 | done 10 | -------------------------------------------------------------------------------- /docs/_data/authors.yml: -------------------------------------------------------------------------------- 1 | 2 | sjt: 3 | full_name: Sean J. Taylor 4 | fbid: 605889 5 | 6 | bletham: 7 | full_name: Ben Letham 8 | fbid: 605889 -------------------------------------------------------------------------------- /docs/_data/features.yml: -------------------------------------------------------------------------------- 1 | - title: Accurate and fast. 2 | text: | 3 | Prophet is used in many applications across Facebook for producing reliable forecasts for planning and goal setting. We've found it to perform better than any other approach in the majority of cases. We fit models in [Stan](http://mc-stan.org) so that you get forecasts in just a few seconds. 4 | align: left 5 | 6 | - title: Fully automatic. 7 | text: | 8 | Get a reasonable forecast on messy data with no manual effort. Prophet is robust to outliers, missing data, and dramatic changes in your time series. 9 | 10 | - title: Tunable forecasts. 11 | text: | 12 | The Prophet procedure includes many possibilities for users to tweak and adjust forecasts. You can use human-interpretable parameters to improve your forecast by adding your domain knowledge. 13 | 14 | - title: Available in R or Python. 15 | text: | 16 | We've implemented the Prophet procedure in R and Python, but they share the same underlying [Stan](http://mc-stan.org) code for fitting. Use whatever language you're comfortable with to get forecasts. 17 | -------------------------------------------------------------------------------- /docs/_data/nav.yml: -------------------------------------------------------------------------------- 1 | - title: Docs 2 | href: docs/ 3 | category: docs 4 | 5 | - title: GitHub 6 | href: https://github.com/facebook/prophet 7 | category: external 8 | -------------------------------------------------------------------------------- /docs/_data/nav_docs.yml: -------------------------------------------------------------------------------- 1 | - title: Documentation 2 | items: 3 | - id: installation 4 | - id: quick_start 5 | - id: saturating_forecasts 6 | - id: trend_changepoints 7 | - id: seasonality,_holiday_effects,_and_regressors 8 | - id: multiplicative_seasonality 9 | - id: uncertainty_intervals 10 | - id: outliers 11 | - id: non-daily_data 12 | - id: diagnostics 13 | - id: handling_shocks 14 | - id: additional_topics 15 | - id: contributing 16 | 17 | # n title:, 1 items: per title:, n id: per items: 18 | # - title: A 19 | # items: 20 | # - id: B 21 | # - id: C 22 | # - title: D 23 | # - id: E 24 | -------------------------------------------------------------------------------- /docs/_data/powered_by.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/_data/powered_by.yml -------------------------------------------------------------------------------- /docs/_data/powered_by_highlight.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/_data/powered_by_highlight.yml -------------------------------------------------------------------------------- /docs/_data/promo.yml: -------------------------------------------------------------------------------- 1 | # This file determines the list of promotional elements added to the header of \ 2 | # your site's homepage. Full list of plugins are shown 3 | 4 | - type: plugin_row 5 | children: 6 | - type: button 7 | href: docs/installation.html 8 | text: Install Prophet 9 | - type: button 10 | href: docs/quick_start.html#r-api 11 | text: Get started in R 12 | - type: button 13 | href: docs/quick_start.html#python-api 14 | text: Get started in Python 15 | - type: button 16 | href: https://peerj.com/preprints/3190/ 17 | text: Read the paper 18 | -------------------------------------------------------------------------------- /docs/_docs/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: docs 3 | docid: "installation" 4 | title: "Installation" 5 | permalink: /docs/installation.html 6 | subsections: 7 | - id: r 8 | title: Using R 9 | - id: python 10 | title: Using Python 11 | --- 12 | 13 | Prophet has two implementations: [R](#installation-in-r) and [Python](#installation-in-python). 14 | 15 | 16 | 17 | ## Installation in R 18 | 19 | Prophet is a [CRAN package](https://cran.r-project.org/package=prophet) so you can use `install.packages`. 20 | 21 | ```r 22 | # R 23 | install.packages('prophet') 24 | ``` 25 | 26 | After installation, you can [get started!](quick_start.html#r-api) 27 | 28 | #### Experimental backend - cmdstanr 29 | 30 | You can also choose an experimental alternative stan backend called `cmdstanr`. Once you've installed `prophet`, 31 | follow these instructions to use `cmdstanr` instead of `rstan` as the backend: 32 | 33 | ```r 34 | # R 35 | # We recommend running this is a fresh R session or restarting your current session 36 | install.packages(c("cmdstanr", "posterior"), repos = c("https://mc-stan.org/r-packages/", getOption("repos"))) 37 | 38 | # If you haven't installed cmdstan before, run: 39 | cmdstanr::install_cmdstan() 40 | # Otherwise, you can point cmdstanr to your cmdstan path: 41 | cmdstanr::set_cmdstan_path(path = ) 42 | 43 | # Set the R_STAN_BACKEND environment variable 44 | Sys.setenv(R_STAN_BACKEND = "CMDSTANR") 45 | ``` 46 | 47 | ### Windows 48 | 49 | On Windows, R requires a compiler so you'll need to [follow the instructions](https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows) provided by `rstan`. The key step is installing [Rtools](http://cran.r-project.org/bin/windows/Rtools/) before attempting to install the package. 50 | 51 | If you have custom Stan compiler settings, install from source rather than the CRAN binary. 52 | 53 | 54 | 55 | ## Installation in Python 56 | 57 | Prophet is on PyPI, so you can use `pip` to install it. 58 | 59 | ```bash 60 | python -m pip install prophet 61 | ``` 62 | 63 | * From v0.6 onwards, Python 2 is no longer supported. 64 | * As of v1.0, the package name on PyPI is "prophet"; prior to v1.0 it was "fbprophet". 65 | * As of v1.1, the minimum supported Python version is 3.7. 66 | 67 | After installation, you can [get started!](quick_start.html#python-api) 68 | 69 | ### Anaconda 70 | 71 | Prophet can also be installed through conda-forge. 72 | 73 | ```bash 74 | conda install -c conda-forge prophet 75 | ``` 76 | -------------------------------------------------------------------------------- /docs/_includes/blog_pagination.html: -------------------------------------------------------------------------------- 1 | 2 | {% if paginator.total_pages > 1 %} 3 |
4 | 27 |
28 | {% endif %} 29 | -------------------------------------------------------------------------------- /docs/_includes/content/gridblocks.html: -------------------------------------------------------------------------------- 1 |
2 | {% for item in {{include.data_source}} %} 3 | {% include content/items/gridblock.html item=item layout=include.layout imagealign=include.imagealign align=include.align %} 4 | {% endfor %} 5 |
-------------------------------------------------------------------------------- /docs/_includes/content/items/gridblock.html: -------------------------------------------------------------------------------- 1 | {% if include.layout == "fourColumn" %} 2 | {% assign layout = "fourByGridBlock" %} 3 | {% else %} 4 | {% assign layout = "twoByGridBlock" %} 5 | {% endif %} 6 | 7 | {% if include.imagealign == "side" %} 8 | {% assign imagealign = "imageAlignSide" %} 9 | {% else %} 10 | {% if item.image %} 11 | {% assign imagealign = "imageAlignTop" %} 12 | {% else %} 13 | {% assign imagealign = "" %} 14 | {% endif %} 15 | {% endif %} 16 | 17 | {% if include.align == "right" %} 18 | {% assign align = "alignRight" %} 19 | {% elsif include.align == "center" %} 20 | {% assign align = "alignCenter" %} 21 | {% else %} 22 | {% assign align = "alignLeft" %} 23 | {% endif %} 24 | 25 |
26 | {% if item.image %} 27 |
28 | {{ item.title }} 29 |
30 | {% endif %} 31 |
32 |

{{ item.title }}

33 | {% if item.text %} 34 | {{ item.text | markdownify }} 35 | {% endif %} 36 |
37 |
38 | -------------------------------------------------------------------------------- /docs/_includes/doc.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

{% if include.truncate %}{{ page.title }}{% else %}{{ page.title }}{% endif %}

4 |
5 | 6 |
7 | {% if include.truncate %} 8 | {% if page.content contains '' %} 9 | {{ page.content | split:'' | first }} 10 | 15 | {% else %} 16 | {{ page.content }} 17 | {% endif %} 18 | {% else %} 19 | {{ content }} 20 | 21 |

Edit on GitHub

22 | {% endif %} 23 |
24 | {% include doc_paging.html %} 25 |
26 | -------------------------------------------------------------------------------- /docs/_includes/doc_paging.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/_includes/doc_paging.html -------------------------------------------------------------------------------- /docs/_includes/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {% seo %} 7 | 8 | 9 | 10 | {% if site.searchconfig %} 11 | 12 | {% endif %} 13 | 14 | {% comment %} 15 | For our RSS feed.xml 16 | https://help.github.com/articles/atom-rss-feeds-for-github-pages/ 17 | {% endcomment %} 18 | {% feed_meta %} 19 | 20 | -------------------------------------------------------------------------------- /docs/_includes/header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |

{{ site.title }}

6 |

{{ site.tagline }}

7 | 8 |
9 |

{% if page.excerpt %}{{ page.excerpt | strip_html }}{% else %}{{ site.description }}{% endif %}

10 |
11 |
12 | {% for promo in site.data.promo %} 13 | {% include plugins/{{promo.type}}.html button_href=promo.href button_text=promo.text %} 14 |
15 | {% endfor %} 16 |
17 |
18 |
19 |
20 | -------------------------------------------------------------------------------- /docs/_includes/hero.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/_includes/hero.html -------------------------------------------------------------------------------- /docs/_includes/home_header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

{{ site.tagline }}

6 |
7 |

{% if page.excerpt %}{{ page.excerpt | strip_html }}{% else %}{{ site.description }}{% endif %}

8 |
9 |
10 | {% for promo in site.data.promo %} 11 |
12 | {% include plugins/{{promo.type}}.html href=promo.href text=promo.text children=promo.children %} 13 |
14 | {% endfor %} 15 |
16 |
17 | 20 |
21 |
22 |
23 | -------------------------------------------------------------------------------- /docs/_includes/katex_import.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/_includes/nav.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | 7 | 8 | 26 | 29 |
30 |
31 |
32 | -------------------------------------------------------------------------------- /docs/_includes/nav/collection_nav.html: -------------------------------------------------------------------------------- 1 |
2 | 37 |
38 | 65 | 66 | -------------------------------------------------------------------------------- /docs/_includes/nav/collection_nav_group.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_includes/nav/collection_nav_group_item.html: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /docs/_includes/nav/header_nav.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 21 |
22 | -------------------------------------------------------------------------------- /docs/_includes/nav_search.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /docs/_includes/plugins/all_share.html: -------------------------------------------------------------------------------- 1 |
2 | {% include plugins/like_button.html %}{% include plugins/twitter_share.html %}{% include plugins/google_share.html %} 3 |
-------------------------------------------------------------------------------- /docs/_includes/plugins/ascii_cinema.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /docs/_includes/plugins/button.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_includes/plugins/github_star.html: -------------------------------------------------------------------------------- 1 |
2 | Star 3 |
4 | -------------------------------------------------------------------------------- /docs/_includes/plugins/github_watch.html: -------------------------------------------------------------------------------- 1 |
2 | Watch 3 |
4 | -------------------------------------------------------------------------------- /docs/_includes/plugins/google_share.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/_includes/plugins/iframe.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 | {% include plugins/button.html href=include.href text=include.text %} 6 |
-------------------------------------------------------------------------------- /docs/_includes/plugins/like_button.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /docs/_includes/plugins/plugin_row.html: -------------------------------------------------------------------------------- 1 |
2 | {% for child in include.children %} 3 | {% include plugins/{{child.type}}.html href=child.href text=child.text %} 4 | {% endfor %} 5 |
-------------------------------------------------------------------------------- /docs/_includes/plugins/post_social_plugins.html: -------------------------------------------------------------------------------- 1 |
2 | 8 |
15 |
16 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/_includes/plugins/slideshow.html: -------------------------------------------------------------------------------- 1 |
2 | 14 | 15 | -------------------------------------------------------------------------------- /docs/_includes/plugins/twitter_follow.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /docs/_includes/plugins/twitter_share.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /docs/_includes/post.html: -------------------------------------------------------------------------------- 1 |
2 | {% assign author = site.data.authors[page.author] %} 3 |
4 | {% if author.fbid %} 5 |
6 | {{ author.fullname }} 7 |
8 | {% endif %} 9 | {% if author.full_name %} 10 | 11 | {% endif %} 12 |

{% if include.truncate %}{{ page.title }}{% else %}{{ page.title }}{% endif %}

13 | 14 |
15 | 16 |
17 | {% if include.truncate %} 18 | {% if page.content contains '' %} 19 | {{ page.content | split:'' | first | markdownify }} 20 | 25 | {% else %} 26 | {{ page.content | markdownify }} 27 | {% endif %} 28 | {% else %} 29 | {{ content }} 30 | {% endif %} 31 | {% unless include.truncate %} 32 | {% include plugins/all_share.html %} 33 | {% endunless %} 34 |
35 |
36 | -------------------------------------------------------------------------------- /docs/_includes/powered_by.html: -------------------------------------------------------------------------------- 1 | {% if site.data.powered_by.first.items or site.data.powered_by_highlight.first.items %} 2 |
3 |
4 | {% if site.data.powered_by_highlight.first.title %} 5 |

{{ site.data.powered_by_highlight.first.title }}

6 | {% else %} 7 |

{{ site.data.powered_by.first.title }}

8 | {% endif %} 9 | {% if site.data.powered_by_highlight.first.items %} 10 |
11 | {% for item in site.data.powered_by_highlight.first.items %} 12 |
13 | {{ item.name }} 14 |
15 | {% endfor %} 16 |
17 | {% endif %} 18 |
19 | {% for item in site.data.powered_by.first.items %} 20 |
21 | {{ item.name }} 22 |
23 | {% endfor %} 24 |
25 |
Does your app use {{ site.title }}? Add it to this list with a pull request!
26 |
27 |
28 | {% endif %} 29 | -------------------------------------------------------------------------------- /docs/_includes/social_plugins.html: -------------------------------------------------------------------------------- 1 | 7 |
14 | 15 |
16 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/_includes/ui/button.html: -------------------------------------------------------------------------------- 1 | {{ include.button_text }} -------------------------------------------------------------------------------- /docs/_layouts/basic.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc_default 3 | --- 4 | 5 |
6 |
7 |
8 | {{ content }} 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /docs/_layouts/blog.html: -------------------------------------------------------------------------------- 1 | --- 2 | category: blog 3 | layout: blog_default 4 | --- 5 | 6 |
7 |
8 | {{ content }} 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /docs/_layouts/blog_default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 | {% include nav.html alwayson=true %} 6 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 | {% include nav.html alwayson=true %} 6 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/_layouts/doc_default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 | {% include nav.html alwayson=true %} 6 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/_layouts/doc_page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc_default 3 | --- 4 | 5 |
6 |
7 | {{ content }} 8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /docs/_layouts/docs.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc_page 3 | --- 4 | 5 | {% include doc.html %} -------------------------------------------------------------------------------- /docs/_layouts/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 |
6 |
7 | Support Ukraine 🇺🇦 8 | 9 | Help Provide Humanitarian Aid to Ukraine 10 | 11 | . 12 |
13 |
14 | {% include nav.html alwayson=true %} 15 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs/_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog 3 | --- 4 | -------------------------------------------------------------------------------- /docs/_layouts/plain.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 |
7 | {{ content }} 8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /docs/_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | collection: blog 3 | layout: blog 4 | --- 5 | 6 |
7 | {% include post.html %} 8 |
-------------------------------------------------------------------------------- /docs/_layouts/redirect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/_layouts/top-level.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 |
7 | {{ content }} 8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /docs/_sass/_blog.scss: -------------------------------------------------------------------------------- 1 | .blogContainer { 2 | .posts { 3 | margin-top: 60px; 4 | 5 | .post { 6 | border: 1px solid $primary-bg; 7 | border-radius: 3px; 8 | padding: 10px 20px 20px; 9 | } 10 | } 11 | 12 | .lonePost { 13 | margin-top: 60px; 14 | 15 | .post { 16 | padding: 10px 0px 0px; 17 | } 18 | } 19 | 20 | .post-header { 21 | h1 { 22 | text-align: center; 23 | } 24 | 25 | .post-authorName { 26 | color: rgba($text, 0.7); 27 | font-size: 14px; 28 | font-weight: 900; 29 | margin-top: 0; 30 | padding: 0; 31 | text-align: center; 32 | } 33 | 34 | .authorPhoto { 35 | border-radius: 50%; 36 | height: 50px; 37 | left: 50%; 38 | margin-left: -25px; 39 | overflow: hidden; 40 | position: absolute; 41 | top: -25px; 42 | width: 50px; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /docs/_sass/_buttons.scss: -------------------------------------------------------------------------------- 1 | .button { 2 | border: 1px solid $primary-bg; 3 | border-radius: 3px; 4 | color: $primary-bg; 5 | display: inline-block; 6 | font-size: 14px; 7 | font-weight: 900; 8 | line-height: 1.2em; 9 | padding: 10px; 10 | text-transform: uppercase; 11 | transition: background 0.3s, color 0.3s; 12 | 13 | &:hover { 14 | background: $primary-bg; 15 | color: $primary-overlay; 16 | } 17 | } 18 | 19 | .homeContainer { 20 | .button { 21 | border-color: $primary-overlay; 22 | border-width: 1px; 23 | color: $primary-overlay; 24 | 25 | &:hover { 26 | background: $primary-overlay; 27 | color: $primary-bg; 28 | } 29 | } 30 | } 31 | 32 | .blockButton { 33 | display: block; 34 | } 35 | 36 | .edit-page-link { 37 | float: right; 38 | font-size: 14px; 39 | font-weight: normal; 40 | line-height: 20px; 41 | opacity: 0.6; 42 | transition: opacity 0.5s; 43 | } 44 | 45 | .edit-page-link:hover { 46 | opacity: 1; 47 | } 48 | -------------------------------------------------------------------------------- /docs/_sass/_footer.scss: -------------------------------------------------------------------------------- 1 | .footerContainer { 2 | background: $secondary-bg; 3 | color: $primary-bg; 4 | overflow: hidden; 5 | padding: 0 10px; 6 | text-align: left; 7 | 8 | .footerWrapper { 9 | border-top: 1px solid $primary-bg; 10 | padding: 0; 11 | 12 | .footerBlocks { 13 | align-items: center; 14 | align-content: center; 15 | display: flex; 16 | flex-flow: row wrap; 17 | margin: 0 -20px; 18 | padding: 10px 0; 19 | } 20 | 21 | .footerSection { 22 | box-sizing: border-box; 23 | flex: 1 1 25%; 24 | font-size: 14px; 25 | min-width: 275px; 26 | padding: 0px 20px; 27 | 28 | a { 29 | border: 0; 30 | color: inherit; 31 | display: inline-block; 32 | line-height: 1.2em; 33 | } 34 | 35 | .footerLink { 36 | padding-right: 20px; 37 | } 38 | } 39 | 40 | .fbOpenSourceFooter { 41 | align-items: center; 42 | display: flex; 43 | flex-flow: row nowrap; 44 | max-width: 25%; 45 | 46 | .facebookOSSLogoSvg { 47 | flex: 0 0 31px; 48 | height: 30px; 49 | margin-right: 10px; 50 | width: 31px; 51 | 52 | path { 53 | fill: $primary-bg; 54 | } 55 | 56 | .middleRing { 57 | opacity: 0.7; 58 | } 59 | 60 | .innerRing { 61 | opacity: 0.45; 62 | } 63 | } 64 | 65 | h2 { 66 | display: block; 67 | font-weight: 900; 68 | line-height: 1em; 69 | } 70 | } 71 | } 72 | } 73 | 74 | @media only screen and (min-width: 900px) { 75 | .footerSection { 76 | &.rightAlign { 77 | margin-left: auto; 78 | max-width: 25%; 79 | text-align: right; 80 | } 81 | } 82 | } -------------------------------------------------------------------------------- /docs/_sass/_gridBlock.scss: -------------------------------------------------------------------------------- 1 | .gridBlock { 2 | margin: -5px 0; 3 | padding: 0; 4 | padding-bottom: 20px; 5 | 6 | .blockElement { 7 | padding: 5px 0; 8 | 9 | img { 10 | max-width: 100%; 11 | } 12 | 13 | h3 { 14 | border-bottom: 1px solid rgba($primary-bg, 0.5); 15 | color: $primary-bg; 16 | font-size: 18px; 17 | margin: 0; 18 | padding: 10px 0; 19 | } 20 | } 21 | 22 | .gridClear { 23 | clear: both; 24 | } 25 | 26 | } 27 | 28 | .gridBlock .alignCenter { 29 | text-align: center; 30 | } 31 | .gridBlock .alignRight { 32 | text-align: right; 33 | } 34 | .gridBlock .imageAlignSide { 35 | align-items: center; 36 | display: flex; 37 | flex-flow: row wrap; 38 | } 39 | .blockImage { 40 | max-width: 150px; 41 | width: 50%; 42 | } 43 | .imageAlignTop .blockImage { 44 | margin-bottom: 20px; 45 | } 46 | .imageAlignTop.alignCenter .blockImage { 47 | margin-left: auto; 48 | margin-right: auto; 49 | } 50 | .imageAlignSide .blockImage { 51 | flex: 0 1 100px; 52 | margin-right: 20px; 53 | } 54 | .imageAlignSide .blockContent { 55 | flex: 1 1; 56 | } 57 | 58 | @media only screen and (max-width: 1023px) { 59 | .responsiveList .blockContent { 60 | position: relative; 61 | } 62 | .responsiveList .blockContent > div { 63 | padding-left: 20px; 64 | } 65 | .responsiveList .blockContent::before { 66 | content: "\2022"; 67 | position: absolute; 68 | } 69 | } 70 | 71 | @media only screen and (min-width: 1024px) { 72 | .gridBlock { 73 | display: flex; 74 | flex-direction: row; 75 | flex-wrap: wrap; 76 | margin: -10px -10px 10px -10px; 77 | 78 | .twoByGridBlock { 79 | box-sizing: border-box; 80 | flex: 1 0 50%; 81 | padding: 10px; 82 | } 83 | 84 | .fourByGridBlock { 85 | box-sizing: border-box; 86 | flex: 1 0 25%; 87 | padding: 10px; 88 | } 89 | } 90 | 91 | h2 + .gridBlock { 92 | padding-top: 20px; 93 | } 94 | } 95 | 96 | @media only screen and (min-width: 1400px) { 97 | .gridBlock { 98 | display: flex; 99 | flex-direction: row; 100 | flex-wrap: wrap; 101 | margin: -10px -20px 10px -20px; 102 | 103 | .twoByGridBlock { 104 | box-sizing: border-box; 105 | flex: 1 0 50%; 106 | padding: 10px 20px; 107 | } 108 | 109 | .fourByGridBlock { 110 | box-sizing: border-box; 111 | flex: 1 0 25%; 112 | padding: 10px 20px; 113 | } 114 | } 115 | } -------------------------------------------------------------------------------- /docs/_sass/_header.scss: -------------------------------------------------------------------------------- 1 | .fixedHeaderContainer { 2 | background: $primary-bg; 3 | color: $primary-overlay; 4 | height: $header-height; 5 | padding: $header-ptop 0 $header-pbot; 6 | position: fixed; 7 | width: 100%; 8 | z-index: 9999; 9 | 10 | a { 11 | align-items: center; 12 | border: 0; 13 | color: $primary-overlay; 14 | display: flex; 15 | flex-flow: row nowrap; 16 | height: $header-height; 17 | } 18 | 19 | header { 20 | display: flex; 21 | flex-flow: row nowrap; 22 | position: relative; 23 | text-align: left; 24 | 25 | img { 26 | height: 24px; 27 | margin-right: 10px; 28 | } 29 | 30 | h2 { 31 | display: block; 32 | font-family: $header-font-family; 33 | font-weight: 900; 34 | line-height: 18px; 35 | position: relative; 36 | } 37 | } 38 | } 39 | 40 | .navigationFull { 41 | height: 34px; 42 | margin-left: auto; 43 | 44 | nav { 45 | position: relative; 46 | 47 | ul { 48 | display: flex; 49 | flex-flow: row nowrap; 50 | margin: 0 -10px; 51 | 52 | li { 53 | padding: 0 10px; 54 | display: block; 55 | 56 | a { 57 | border: 0; 58 | color: $primary-overlay-special; 59 | font-size: 16px; 60 | font-weight: 400; 61 | line-height: 1.2em; 62 | 63 | &:hover { 64 | border-bottom: 2px solid $primary-overlay; 65 | color: $primary-overlay; 66 | } 67 | } 68 | 69 | &.navItemActive { 70 | a { 71 | color: $primary-overlay; 72 | } 73 | } 74 | } 75 | } 76 | } 77 | } 78 | 79 | /* 900px 80 | 81 | 82 | .fixedHeaderContainer { 83 | .navigationWrapper { 84 | nav { 85 | padding: 0 1em; 86 | position: relative; 87 | top: -9px; 88 | 89 | ul { 90 | margin: 0 -0.4em; 91 | li { 92 | display: inline-block; 93 | 94 | a { 95 | padding: 14px 0.4em; 96 | border: 0; 97 | color: $primary-overlay-special; 98 | display: inline-block; 99 | 100 | &:hover { 101 | color: $primary-overlay; 102 | } 103 | } 104 | 105 | &.navItemActive { 106 | a { 107 | color: $primary-overlay; 108 | } 109 | } 110 | } 111 | } 112 | } 113 | 114 | &.navigationFull { 115 | display: inline-block; 116 | } 117 | 118 | &.navigationSlider { 119 | display: none; 120 | } 121 | } 122 | } 123 | 124 | 1200px 125 | 126 | .fixedHeaderContainer { 127 | header { 128 | max-width: 1100px; 129 | } 130 | } 131 | 132 | 1500px 133 | .fixedHeaderContainer { 134 | header { 135 | max-width: 1400px; 136 | } 137 | } 138 | */ -------------------------------------------------------------------------------- /docs/_sass/_poweredby.scss: -------------------------------------------------------------------------------- 1 | .poweredByContainer { 2 | background: $primary-bg; 3 | color: $primary-overlay; 4 | margin-bottom: 20px; 5 | 6 | a { 7 | color: $primary-overlay; 8 | } 9 | 10 | .poweredByWrapper { 11 | h2 { 12 | border-color: $primary-overlay-special; 13 | color: $primary-overlay-special; 14 | } 15 | } 16 | 17 | .poweredByMessage { 18 | color: $primary-overlay-special; 19 | font-size: 14px; 20 | padding-top: 20px; 21 | } 22 | } 23 | 24 | .poweredByItems { 25 | display: flex; 26 | flex-flow: row wrap; 27 | margin: 0 -10px; 28 | } 29 | 30 | .poweredByItem { 31 | box-sizing: border-box; 32 | flex: 1 0 50%; 33 | line-height: 1.1em; 34 | padding: 5px 10px; 35 | 36 | &.itemLarge { 37 | flex-basis: 100%; 38 | padding: 10px; 39 | text-align: center; 40 | 41 | &:nth-child(4) { 42 | padding-bottom: 20px; 43 | } 44 | 45 | img { 46 | max-height: 30px; 47 | } 48 | } 49 | } 50 | 51 | @media only screen and (min-width: 480px) { 52 | .itemLarge { 53 | flex-basis: 50%; 54 | max-width: 50%; 55 | } 56 | } 57 | 58 | @media only screen and (min-width: 1024px) { 59 | .poweredByItem { 60 | flex-basis: 25%; 61 | max-width: 25%; 62 | 63 | &.itemLarge { 64 | padding-bottom: 20px; 65 | text-align: left; 66 | } 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /docs/_sass/_promo.scss: -------------------------------------------------------------------------------- 1 | .promoSection { 2 | display: flex; 3 | flex-flow: column wrap; 4 | font-size: 125%; 5 | line-height: 1.6em; 6 | margin: -10px 0; 7 | position: relative; 8 | z-index: 99; 9 | 10 | .promoRow { 11 | padding: 10px 0; 12 | 13 | .pluginWrapper { 14 | display: block; 15 | 16 | &.ghWatchWrapper, &.ghStarWrapper { 17 | height: 28px; 18 | } 19 | } 20 | 21 | .pluginRowBlock { 22 | display: flex; 23 | flex-flow: row wrap; 24 | margin: 0 -2px; 25 | 26 | .pluginWrapper { 27 | padding: 0 2px; 28 | } 29 | } 30 | } 31 | } 32 | 33 | iframe.pluginIframe { 34 | height: 500px; 35 | margin-top: 20px; 36 | width: 100%; 37 | } 38 | 39 | .iframeContent { 40 | display: none; 41 | } 42 | 43 | .iframePreview { 44 | display: inline-block; 45 | margin-top: 20px; 46 | } 47 | 48 | @media only screen and (min-width: 1024px) { 49 | .iframeContent { 50 | display: block; 51 | } 52 | .iframePreview { 53 | display: none; 54 | } 55 | } -------------------------------------------------------------------------------- /docs/_sass/_reset.scss: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td, 10 | article, aside, canvas, details, embed, 11 | figure, figcaption, footer, header, hgroup, 12 | menu, nav, output, ruby, section, summary, 13 | time, mark, audio, video { 14 | margin: 0; 15 | padding: 0; 16 | border: 0; 17 | font-size: 100%; 18 | font: inherit; 19 | vertical-align: baseline; 20 | } 21 | /* HTML5 display-role reset for older browsers */ 22 | article, aside, details, figcaption, figure, 23 | footer, header, hgroup, menu, nav, section { 24 | display: block; 25 | } 26 | body { 27 | line-height: 1; 28 | } 29 | ol, ul { 30 | list-style: none; 31 | } 32 | blockquote, q { 33 | quotes: none; 34 | } 35 | blockquote:before, blockquote:after, 36 | q:before, q:after { 37 | content: ''; 38 | content: none; 39 | } 40 | table { 41 | border-collapse: collapse; 42 | border-spacing: 0; 43 | } 44 | -------------------------------------------------------------------------------- /docs/_sass/_slideshow.scss: -------------------------------------------------------------------------------- 1 | .slideshow { 2 | position: relative; 3 | 4 | .slide { 5 | display: none; 6 | 7 | img { 8 | display: block; 9 | margin: 0 auto; 10 | } 11 | 12 | &.slideActive { 13 | display: block; 14 | } 15 | 16 | a { 17 | border: none; 18 | display: block; 19 | } 20 | } 21 | 22 | .pagination { 23 | display: block; 24 | margin: -10px; 25 | padding: 1em 0; 26 | text-align: center; 27 | width: 100%; 28 | 29 | .pager { 30 | background: transparent; 31 | border: 2px solid rgba(255, 255, 255, 0.5); 32 | border-radius: 50%; 33 | cursor: pointer; 34 | display: inline-block; 35 | height: 12px; 36 | margin: 10px; 37 | transition: background-color 0.3s, border-color 0.3s; 38 | width: 12px; 39 | 40 | &.pagerActive { 41 | background: rgba(255, 255, 255, 0.5); 42 | border-width: 4px; 43 | height: 8px; 44 | width: 8px; 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /docs/_sass/_tables.scss: -------------------------------------------------------------------------------- 1 | table { 2 | background: $lightergrey; 3 | border: 1px solid $lightgrey; 4 | border-collapse: collapse; 5 | display:table; 6 | margin: 20px 0; 7 | 8 | thead { 9 | border-bottom: 1px solid $lightgrey; 10 | display: table-header-group; 11 | } 12 | tbody { 13 | display: table-row-group; 14 | } 15 | tr { 16 | display: table-row; 17 | &:nth-of-type(odd) { 18 | background: $greyish; 19 | } 20 | 21 | th, td { 22 | border-right: 1px dotted $lightgrey; 23 | display: table-cell; 24 | font-size: 14px; 25 | line-height: 1.3em; 26 | padding: 10px; 27 | text-align: left; 28 | 29 | &:last-of-type { 30 | border-right: 0; 31 | } 32 | 33 | code { 34 | color: $green; 35 | display: inline-block; 36 | font-size: 12px; 37 | } 38 | } 39 | 40 | th { 41 | color: #000000; 42 | font-weight: bold; 43 | font-family: $header-font-family; 44 | text-transform: uppercase; 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /docs/blog/all.html: -------------------------------------------------------------------------------- 1 | --- 2 | id: all 3 | layout: blog 4 | category: blog 5 | --- 6 | 7 |
8 |
9 |

All Posts

10 | {% for post in site.posts %} 11 | {% assign author = site.data.authors[post.author] %} 12 |

13 | 14 | {{ post.title }} 15 | 16 | on {{ post.date | date: "%B %e, %Y" }} by {{ author.display_name }} 17 |

18 | {% endfor %} 19 |
20 |
21 | -------------------------------------------------------------------------------- /docs/blog/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | id: blog 3 | title: Blog 4 | layout: blog 5 | category: blog 6 | --- 7 | 8 |
9 | {% for page in site.posts %} 10 | {% include post.html truncate=true %} 11 | {% endfor %} 12 |
13 | -------------------------------------------------------------------------------- /docs/docs/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs 3 | title: Docs 4 | layout: redirect 5 | destination: quick_start.html 6 | --- 7 | -------------------------------------------------------------------------------- /docs/feed.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | --- 4 | 5 | 6 | 7 | {{ site.title | xml_escape }} 8 | {{ site.description | xml_escape }} 9 | {{ '/' | absolute_url }} 10 | 11 | {{ site.time | date_to_rfc822 }} 12 | {{ site.time | date_to_rfc822 }} 13 | Jekyll v{{ jekyll.version }} 14 | {% for post in site.posts limit:10 %} 15 | 16 | {{ post.title | xml_escape }} 17 | {{ post.content | xml_escape }} 18 | {{ post.date | date_to_rfc822 }} 19 | {{ post.url | absolute_url }} 20 | {{ post.url | absolute_url }} 21 | {% for tag in post.tags %} 22 | {{ tag | xml_escape }} 23 | {% endfor %} 24 | {% for cat in post.categories %} 25 | {{ cat | xml_escape }} 26 | {% endfor %} 27 | 28 | {% endfor %} 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: home 3 | title: Prophet 4 | id: home 5 | --- 6 | ## Watch Introductory Video 7 | 8 |
9 | 10 |
11 | 12 | Prophet is 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. 13 | 14 | Prophet is [open source software](https://code.facebook.com/projects/) released by Facebook's [Core Data Science team](https://research.fb.com/category/data-science/). It is available for download on [CRAN](https://cran.r-project.org/package=prophet) and [PyPI](https://pypi.python.org/pypi/prophet/). 15 | 16 | ----- 17 | 18 | **2023 Update:** We discuss our plans for the future of Prophet in this blog post: [facebook/prophet in 2023 and beyond](https://medium.com/@cuongduong_35162/facebook-prophet-in-2023-and-beyond-c5086151c138) 19 | 20 | ----- 21 | 22 | {% include content/gridblocks.html data_source=site.data.features layout="fourColumn" align="left" %} 23 | -------------------------------------------------------------------------------- /docs/nbconvert_template.tpl: -------------------------------------------------------------------------------- 1 | {%- extends 'markdown/index.md.j2' -%} 2 | 3 | {%- block header -%} 4 | --- 5 | layout: docs 6 | docid: "{{resources['metadata']['name']}}" 7 | title: "{{resources['metadata']['name'].replace('_', ' ').title()}}" 8 | permalink: /docs/{{resources['metadata']['name']}}.html 9 | subsections: 10 | {%- for cell in nb['cells'] if cell.cell_type == 'markdown' and '##' in cell.source -%} 11 | {% for line in cell.source.split('\n') if line.startswith('##') %} 12 | - title: {{ line.lstrip('# ') }} 13 | id: {{ line.lstrip('# ').lower().replace(' ', '-') }} 14 | {%- endfor -%} 15 | {% endfor %} 16 | --- 17 | {%- endblock header -%} 18 | 19 | {%- block any_cell -%} 20 | {%- if not cell.metadata.get("block_hidden", False) -%} 21 | {{ super() }} 22 | {%- endif -%} 23 | {%- endblock any_cell -%} 24 | 25 | {% block input %} 26 | {%- if cell.source[:3] == "%%R" -%} 27 | ```R 28 | # R 29 | {{ '\n'.join(cell.source.split('\n')[1:]) }} 30 | ``` 31 | {%- else -%} 32 | ```python 33 | # Python 34 | {{ cell.source }} 35 | ``` 36 | {%- endif -%} 37 | {%- endblock input -%} 38 | 39 | {%- block output_group -%} 40 | {%- if not cell.metadata.get("output_hidden", False) -%} 41 | {{ super() }} 42 | {%- endif -%} 43 | {%- endblock output_group -%} 44 | 45 | {%- block input_group -%} 46 | {%- if not cell.metadata.get("input_hidden", False) -%} 47 | {{ super() }} 48 | {%- endif -%} 49 | {%- endblock input_group -%} 50 | 51 | {% block data_png %} 52 | ![png](/prophet/static/{{ output.metadata.filenames['image/png'] }}) 53 | {% endblock data_png %} 54 | 55 | {% block markdowncell %} 56 | {%- set lines = cell.source.split('\n') -%} 57 | {%- for line in lines -%} 58 | {% if line.startswith('##') %} 59 | 60 | {% endif %} 61 | {{ line }} 62 | {% endfor %} 63 | {% endblock markdowncell %} 64 | -------------------------------------------------------------------------------- /docs/static/additional_topics_files/additional_topics_16_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/additional_topics_files/additional_topics_16_0.png -------------------------------------------------------------------------------- /docs/static/additional_topics_files/additional_topics_17_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/additional_topics_files/additional_topics_17_0.png -------------------------------------------------------------------------------- /docs/static/additional_topics_files/additional_topics_18_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/additional_topics_files/additional_topics_18_0.png -------------------------------------------------------------------------------- /docs/static/additional_topics_files/additional_topics_28_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/additional_topics_files/additional_topics_28_0.png -------------------------------------------------------------------------------- /docs/static/additional_topics_files/additional_topics_29_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/additional_topics_files/additional_topics_29_0.png -------------------------------------------------------------------------------- /docs/static/diagnostics_files/diagnostics_17_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/diagnostics_files/diagnostics_17_0.png -------------------------------------------------------------------------------- /docs/static/diagnostics_files/diagnostics_18_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/diagnostics_files/diagnostics_18_0.png -------------------------------------------------------------------------------- /docs/static/diagnostics_files/diagnostics_4_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/diagnostics_files/diagnostics_4_0.png -------------------------------------------------------------------------------- /docs/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/favicon.png -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/fonts/LatoLatin-Black.woff -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Black.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/fonts/LatoLatin-Black.woff2 -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-BlackItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/fonts/LatoLatin-BlackItalic.woff -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-BlackItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/fonts/LatoLatin-BlackItalic.woff2 -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/fonts/LatoLatin-Italic.woff -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/fonts/LatoLatin-Italic.woff2 -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/fonts/LatoLatin-Light.woff -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/fonts/LatoLatin-Light.woff2 -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/fonts/LatoLatin-Regular.woff -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/fonts/LatoLatin-Regular.woff2 -------------------------------------------------------------------------------- /docs/static/handling_shocks_files/handling_shocks_15_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/handling_shocks_files/handling_shocks_15_0.png -------------------------------------------------------------------------------- /docs/static/handling_shocks_files/handling_shocks_16_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/handling_shocks_files/handling_shocks_16_0.png -------------------------------------------------------------------------------- /docs/static/handling_shocks_files/handling_shocks_18_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/handling_shocks_files/handling_shocks_18_0.png -------------------------------------------------------------------------------- /docs/static/handling_shocks_files/handling_shocks_22_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/handling_shocks_files/handling_shocks_22_0.png -------------------------------------------------------------------------------- /docs/static/handling_shocks_files/handling_shocks_34_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/handling_shocks_files/handling_shocks_34_0.png -------------------------------------------------------------------------------- /docs/static/handling_shocks_files/handling_shocks_35_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/handling_shocks_files/handling_shocks_35_0.png -------------------------------------------------------------------------------- /docs/static/handling_shocks_files/handling_shocks_4_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/handling_shocks_files/handling_shocks_4_0.png -------------------------------------------------------------------------------- /docs/static/handling_shocks_files/handling_shocks_8_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/handling_shocks_files/handling_shocks_8_0.png -------------------------------------------------------------------------------- /docs/static/handling_shocks_files/handling_shocks_9_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/handling_shocks_files/handling_shocks_9_0.png -------------------------------------------------------------------------------- /docs/static/holiday_effects_files/holiday_effects_12_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/holiday_effects_files/holiday_effects_12_0.png -------------------------------------------------------------------------------- /docs/static/holiday_effects_files/holiday_effects_13_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/holiday_effects_files/holiday_effects_13_0.png -------------------------------------------------------------------------------- /docs/static/images/after-scrolling-down-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/images/after-scrolling-down-example.png -------------------------------------------------------------------------------- /docs/static/images/apple.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 13 | 14 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/static/images/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/images/facebook.png -------------------------------------------------------------------------------- /docs/static/images/instagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/images/instagram.png -------------------------------------------------------------------------------- /docs/static/images/landing-page-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/images/landing-page-example.png -------------------------------------------------------------------------------- /docs/static/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 10 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/static/multiplicative_seasonality_files/multiplicative_seasonality_10_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/multiplicative_seasonality_files/multiplicative_seasonality_10_0.png -------------------------------------------------------------------------------- /docs/static/multiplicative_seasonality_files/multiplicative_seasonality_3_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/multiplicative_seasonality_files/multiplicative_seasonality_3_1.png -------------------------------------------------------------------------------- /docs/static/multiplicative_seasonality_files/multiplicative_seasonality_4_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/multiplicative_seasonality_files/multiplicative_seasonality_4_0.png -------------------------------------------------------------------------------- /docs/static/multiplicative_seasonality_files/multiplicative_seasonality_6_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/multiplicative_seasonality_files/multiplicative_seasonality_6_1.png -------------------------------------------------------------------------------- /docs/static/multiplicative_seasonality_files/multiplicative_seasonality_7_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/multiplicative_seasonality_files/multiplicative_seasonality_7_0.png -------------------------------------------------------------------------------- /docs/static/multiplicative_seasonality_files/multiplicative_seasonality_9_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/multiplicative_seasonality_files/multiplicative_seasonality_9_0.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_10_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_10_0.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_12_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_12_0.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_13_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_13_0.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_15_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_15_1.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_16_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_16_0.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_18_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_18_2.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_19_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_19_1.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_21_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_21_0.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_22_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_22_0.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_3_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_3_1.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_4_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_4_0.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_6_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_6_0.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_7_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_7_0.png -------------------------------------------------------------------------------- /docs/static/non-daily_data_files/non-daily_data_9_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/non-daily_data_files/non-daily_data_9_1.png -------------------------------------------------------------------------------- /docs/static/og_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/og_image.png -------------------------------------------------------------------------------- /docs/static/oss_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/oss_logo.png -------------------------------------------------------------------------------- /docs/static/outliers_files/outliers_10_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/outliers_files/outliers_10_0.png -------------------------------------------------------------------------------- /docs/static/outliers_files/outliers_12_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/outliers_files/outliers_12_1.png -------------------------------------------------------------------------------- /docs/static/outliers_files/outliers_13_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/outliers_files/outliers_13_0.png -------------------------------------------------------------------------------- /docs/static/outliers_files/outliers_3_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/outliers_files/outliers_3_1.png -------------------------------------------------------------------------------- /docs/static/outliers_files/outliers_4_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/outliers_files/outliers_4_0.png -------------------------------------------------------------------------------- /docs/static/outliers_files/outliers_6_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/outliers_files/outliers_6_1.png -------------------------------------------------------------------------------- /docs/static/outliers_files/outliers_7_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/outliers_files/outliers_7_0.png -------------------------------------------------------------------------------- /docs/static/outliers_files/outliers_9_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/outliers_files/outliers_9_1.png -------------------------------------------------------------------------------- /docs/static/prophet_paper_20170113.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/prophet_paper_20170113.pdf -------------------------------------------------------------------------------- /docs/static/prophet_paper_preprint.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/prophet_paper_preprint.pdf -------------------------------------------------------------------------------- /docs/static/quick_start_files/quick_start_12_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/quick_start_files/quick_start_12_0.png -------------------------------------------------------------------------------- /docs/static/quick_start_files/quick_start_14_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/quick_start_files/quick_start_14_0.png -------------------------------------------------------------------------------- /docs/static/quick_start_files/quick_start_30_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/quick_start_files/quick_start_30_0.png -------------------------------------------------------------------------------- /docs/static/quick_start_files/quick_start_32_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/quick_start_files/quick_start_32_0.png -------------------------------------------------------------------------------- /docs/static/saturating_forecasts_files/saturating_forecasts_12_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/saturating_forecasts_files/saturating_forecasts_12_0.png -------------------------------------------------------------------------------- /docs/static/saturating_forecasts_files/saturating_forecasts_13_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/saturating_forecasts_files/saturating_forecasts_13_0.png -------------------------------------------------------------------------------- /docs/static/saturating_forecasts_files/saturating_forecasts_15_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/saturating_forecasts_files/saturating_forecasts_15_1.png -------------------------------------------------------------------------------- /docs/static/saturating_forecasts_files/saturating_forecasts_16_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/saturating_forecasts_files/saturating_forecasts_16_0.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_13_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_13_0.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_14_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_14_0.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_23_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_23_0.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_24_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_24_0.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_29_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_29_1.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_30_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_30_0.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_32_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_32_1.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_33_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_33_0.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_35_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_35_1.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_36_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_36_0.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_41_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_41_1.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_42_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_42_0.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_51_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_51_1.png -------------------------------------------------------------------------------- /docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_52_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/seasonality,_holiday_effects,_and_regressors_files/seasonality,_holiday_effects,_and_regressors_52_0.png -------------------------------------------------------------------------------- /docs/static/trend_changepoints_files/trend_changepoints_12_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/trend_changepoints_files/trend_changepoints_12_1.png -------------------------------------------------------------------------------- /docs/static/trend_changepoints_files/trend_changepoints_13_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/trend_changepoints_files/trend_changepoints_13_0.png -------------------------------------------------------------------------------- /docs/static/trend_changepoints_files/trend_changepoints_15_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/trend_changepoints_files/trend_changepoints_15_1.png -------------------------------------------------------------------------------- /docs/static/trend_changepoints_files/trend_changepoints_16_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/trend_changepoints_files/trend_changepoints_16_0.png -------------------------------------------------------------------------------- /docs/static/trend_changepoints_files/trend_changepoints_20_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/trend_changepoints_files/trend_changepoints_20_1.png -------------------------------------------------------------------------------- /docs/static/trend_changepoints_files/trend_changepoints_21_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/trend_changepoints_files/trend_changepoints_21_0.png -------------------------------------------------------------------------------- /docs/static/trend_changepoints_files/trend_changepoints_4_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/trend_changepoints_files/trend_changepoints_4_0.png -------------------------------------------------------------------------------- /docs/static/trend_changepoints_files/trend_changepoints_6_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/trend_changepoints_files/trend_changepoints_6_0.png -------------------------------------------------------------------------------- /docs/static/trend_changepoints_files/trend_changepoints_8_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/trend_changepoints_files/trend_changepoints_8_0.png -------------------------------------------------------------------------------- /docs/static/trend_changepoints_files/trend_changepoints_9_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/trend_changepoints_files/trend_changepoints_9_0.png -------------------------------------------------------------------------------- /docs/static/uncertainty_intervals_files/uncertainty_intervals_10_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/uncertainty_intervals_files/uncertainty_intervals_10_0.png -------------------------------------------------------------------------------- /docs/static/uncertainty_intervals_files/uncertainty_intervals_11_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/docs/static/uncertainty_intervals_files/uncertainty_intervals_11_0.png -------------------------------------------------------------------------------- /docs/static/wordmark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 9 | 11 | 13 | 15 | 17 | 19 | 20 | 22 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/example_air_passengers.csv: -------------------------------------------------------------------------------- 1 | ds,y 1949-01-01,112 1949-02-01,118 1949-03-01,132 1949-04-01,129 1949-05-01,121 1949-06-01,135 1949-07-01,148 1949-08-01,148 1949-09-01,136 1949-10-01,119 1949-11-01,104 1949-12-01,118 1950-01-01,115 1950-02-01,126 1950-03-01,141 1950-04-01,135 1950-05-01,125 1950-06-01,149 1950-07-01,170 1950-08-01,170 1950-09-01,158 1950-10-01,133 1950-11-01,114 1950-12-01,140 1951-01-01,145 1951-02-01,150 1951-03-01,178 1951-04-01,163 1951-05-01,172 1951-06-01,178 1951-07-01,199 1951-08-01,199 1951-09-01,184 1951-10-01,162 1951-11-01,146 1951-12-01,166 1952-01-01,171 1952-02-01,180 1952-03-01,193 1952-04-01,181 1952-05-01,183 1952-06-01,218 1952-07-01,230 1952-08-01,242 1952-09-01,209 1952-10-01,191 1952-11-01,172 1952-12-01,194 1953-01-01,196 1953-02-01,196 1953-03-01,236 1953-04-01,235 1953-05-01,229 1953-06-01,243 1953-07-01,264 1953-08-01,272 1953-09-01,237 1953-10-01,211 1953-11-01,180 1953-12-01,201 1954-01-01,204 1954-02-01,188 1954-03-01,235 1954-04-01,227 1954-05-01,234 1954-06-01,264 1954-07-01,302 1954-08-01,293 1954-09-01,259 1954-10-01,229 1954-11-01,203 1954-12-01,229 1955-01-01,242 1955-02-01,233 1955-03-01,267 1955-04-01,269 1955-05-01,270 1955-06-01,315 1955-07-01,364 1955-08-01,347 1955-09-01,312 1955-10-01,274 1955-11-01,237 1955-12-01,278 1956-01-01,284 1956-02-01,277 1956-03-01,317 1956-04-01,313 1956-05-01,318 1956-06-01,374 1956-07-01,413 1956-08-01,405 1956-09-01,355 1956-10-01,306 1956-11-01,271 1956-12-01,306 1957-01-01,315 1957-02-01,301 1957-03-01,356 1957-04-01,348 1957-05-01,355 1957-06-01,422 1957-07-01,465 1957-08-01,467 1957-09-01,404 1957-10-01,347 1957-11-01,305 1957-12-01,336 1958-01-01,340 1958-02-01,318 1958-03-01,362 1958-04-01,348 1958-05-01,363 1958-06-01,435 1958-07-01,491 1958-08-01,505 1958-09-01,404 1958-10-01,359 1958-11-01,310 1958-12-01,337 1959-01-01,360 1959-02-01,342 1959-03-01,406 1959-04-01,396 1959-05-01,420 1959-06-01,472 1959-07-01,548 1959-08-01,559 1959-09-01,463 1959-10-01,407 1959-11-01,362 1959-12-01,405 1960-01-01,417 1960-02-01,391 1960-03-01,419 1960-04-01,461 1960-05-01,472 1960-06-01,535 1960-07-01,622 1960-08-01,606 1960-09-01,508 1960-10-01,461 1960-11-01,390 1960-12-01,432 -------------------------------------------------------------------------------- /python/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Facebook, Inc. and its affiliates. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /python/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include stan/*.stan 2 | include LICENSE 3 | include pyproject.toml 4 | 5 | # Ensure in-place built models do not get included in the source dist. 6 | prune prophet/stan_model 7 | 8 | # Necessary for tests to run 9 | include prophet/tests/*.csv 10 | include prophet/tests/*.json 11 | -------------------------------------------------------------------------------- /python/README.md: -------------------------------------------------------------------------------- 1 | # Prophet: Automatic Forecasting Procedure 2 | 3 | Prophet is 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. 4 | 5 | Prophet is [open source software](https://code.facebook.com/projects/>) released by [Facebook's Core Data Science team ](https://research.fb.com/category/data-science/). 6 | 7 | Full documentation and examples available at the homepage: https://facebook.github.io/prophet/ 8 | 9 | ## Important links 10 | 11 | - HTML documentation: https://facebook.github.io/prophet/docs/quick_start.html 12 | - Issue tracker: https://github.com/facebook/prophet/issues 13 | - Source code repository: https://github.com/facebook/prophet 14 | - Implementation of Prophet in R: https://cran.r-project.org/package=prophet 15 | 16 | ## Other forecasting packages 17 | 18 | - Rob Hyndman's [forecast package](http://robjhyndman.com/software/forecast/) 19 | - [Statsmodels](http://statsmodels.sourceforge.net/) 20 | 21 | ## Installation - PyPI release 22 | 23 | See [Installation in Python - PyPI release](https://github.com/facebook/prophet#installation-in-python---pypi-release) 24 | 25 | ## Installation - Development version 26 | 27 | See [Installation in Python - Development version](https://github.com/facebook/prophet#installation-in-python---development-version) 28 | 29 | ### Installation using Docker and docker-compose (via Makefile) 30 | 31 | Simply type `make build` and if everything is fine you should be able to `make shell` or alternative jump directly to `make py-shell`. 32 | 33 | To run the tests, inside the container `cd python/prophet` and then `python -m pytest prophet/tests/` 34 | 35 | ### Example usage 36 | 37 | ```python 38 | >>> from prophet import Prophet 39 | >>> m = Prophet() 40 | >>> m.fit(df) # df is a pandas.DataFrame with 'y' and 'ds' columns 41 | >>> future = m.make_future_dataframe(periods=365) 42 | >>> m.predict(future) 43 | ``` 44 | -------------------------------------------------------------------------------- /python/prophet/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-present, Facebook, Inc. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the BSD-style license found in the 5 | # LICENSE file in the root directory of this source tree. An additional grant 6 | # of patent rights can be found in the PATENTS file in the same directory. 7 | from prophet.forecaster import Prophet 8 | 9 | from pathlib import Path 10 | about = {} 11 | here = Path(__file__).parent.resolve() 12 | with open(here / "__version__.py", "r") as f: 13 | exec(f.read(), about) 14 | __version__ = about["__version__"] 15 | -------------------------------------------------------------------------------- /python/prophet/__version__.py: -------------------------------------------------------------------------------- 1 | __version__ = "1.1.7" 2 | -------------------------------------------------------------------------------- /python/prophet/make_holidays.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (c) Facebook, Inc. and its affiliates. 3 | 4 | # This source code is licensed under the MIT license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | from __future__ import absolute_import, division, print_function 8 | 9 | import numpy as np 10 | import pandas as pd 11 | 12 | import holidays 13 | 14 | 15 | def get_country_holidays_class(country): 16 | """Get class for a supported country. 17 | 18 | Parameters 19 | ---------- 20 | country: country code 21 | 22 | Returns 23 | ------- 24 | A valid country holidays class 25 | """ 26 | substitutions = { 27 | "TU": "TR", # For compatibility with Turkey as 'TU' cases. 28 | } 29 | 30 | country = substitutions.get(country, country) 31 | if not hasattr(holidays, country): 32 | raise AttributeError(f"Holidays in {country} are not currently supported!") 33 | 34 | return getattr(holidays, country) 35 | 36 | 37 | def get_holiday_names(country): 38 | """Return all possible holiday names of given country 39 | 40 | Parameters 41 | ---------- 42 | country: country name 43 | 44 | Returns 45 | ------- 46 | A set of all possible holiday names of given country 47 | """ 48 | country_holidays = get_country_holidays_class(country) 49 | return set(country_holidays(language="en_US", years=np.arange(1995, 2045)).values()) 50 | 51 | 52 | def make_holidays_df(year_list, country, province=None, state=None): 53 | """Make dataframe of holidays for given years and countries 54 | 55 | Parameters 56 | ---------- 57 | year_list: a list of years 58 | country: country name 59 | province: province name 60 | 61 | Returns 62 | ------- 63 | Dataframe with 'ds' and 'holiday', which can directly feed 64 | to 'holidays' params in Prophet 65 | """ 66 | country_holidays = get_country_holidays_class(country) 67 | holidays = country_holidays(expand=False, language="en_US", subdiv=province, years=year_list) 68 | 69 | holidays_df = pd.DataFrame( 70 | [(date, holidays.get_list(date)) for date in holidays], 71 | columns=["ds", "holiday"], 72 | ) 73 | holidays_df = holidays_df.explode("holiday") 74 | holidays_df.reset_index(inplace=True, drop=True) 75 | holidays_df["ds"] = pd.to_datetime(holidays_df["ds"]) 76 | 77 | return holidays_df 78 | -------------------------------------------------------------------------------- /python/prophet/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/python/prophet/tests/__init__.py -------------------------------------------------------------------------------- /python/prophet/tests/conftest.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import pandas as pd 4 | import pytest 5 | 6 | 7 | @pytest.fixture(scope="package") 8 | def daily_univariate_ts() -> pd.DataFrame: 9 | """Daily univariate time series with 2 years of data""" 10 | return pd.read_csv(Path(__file__).parent / "data.csv", parse_dates=["ds"]) 11 | 12 | 13 | @pytest.fixture(scope="package") 14 | def subdaily_univariate_ts() -> pd.DataFrame: 15 | """Sub-daily univariate time series""" 16 | return pd.read_csv(Path(__file__).parent / "data2.csv", parse_dates=["ds"]) 17 | 18 | 19 | @pytest.fixture(scope="package") 20 | def large_numbers_ts() -> pd.DataFrame: 21 | """Univariate time series with large values to test scaling""" 22 | return pd.read_csv(Path(__file__).parent / "data3.csv", parse_dates=["ds"]) 23 | 24 | 25 | def pytest_configure(config): 26 | config.addinivalue_line("markers", "slow: mark tests as slow (include in run with --test-slow)") 27 | 28 | 29 | def pytest_addoption(parser): 30 | parser.addoption("--test-slow", action="store_true", default=False, help="Run slow tests") 31 | parser.addoption( 32 | "--backend", 33 | nargs="+", 34 | default=["CMDSTANPY"], 35 | help="Probabilistic Programming Language backend to perform tests with.", 36 | ) 37 | 38 | 39 | def pytest_collection_modifyitems(config, items): 40 | if config.getoption("--test-slow"): 41 | return 42 | skip_slow = pytest.mark.skip(reason="Skipped due to the lack of '--test-slow' argument") 43 | for item in items: 44 | if "slow" in item.keywords: 45 | item.add_marker(skip_slow) 46 | 47 | 48 | def pytest_generate_tests(metafunc): 49 | """ 50 | For each test, if `backend` is used as a fixture, add a parametrization equal to the value of the 51 | --backend option. 52 | 53 | This is used to re-run the test suite for different probabilistic programming language backends 54 | (e.g. cmdstanpy, numpyro). 55 | """ 56 | if "backend" in metafunc.fixturenames: 57 | metafunc.parametrize("backend", metafunc.config.getoption("backend")) 58 | -------------------------------------------------------------------------------- /python/prophet/tests/data3.csv: -------------------------------------------------------------------------------- 1 | ds,y 2 | 2023-03-02,623031970.0 3 | 2023-03-06,623032040.0 4 | 2023-03-07,623032054.0 5 | 2023-03-08,623032091.0 6 | 2023-03-09,623032123.0 7 | 2023-03-10,623032152.0 8 | 2023-03-11,623032177.0 9 | 2023-03-12,623032184.0 10 | 2023-03-13,623032193.0 11 | 2023-03-16,623032296.0 12 | 2023-03-17,623032316.0 13 | 2023-03-18,623032328.0 14 | 2023-03-19,623032339.0 15 | 2023-03-20,623032352.0 16 | 2023-03-21,623032385.0 17 | 2023-03-22,623032410.0 18 | 2023-03-23,623032427.0 19 | 2023-03-25,623032479.0 20 | 2023-03-26,623032496.0 21 | 2023-03-27,623032506.0 22 | 2023-03-28,623032533.0 23 | 2023-03-29,623032598.0 24 | 2023-03-30,623032643.0 25 | 2023-03-31,623032681.0 26 | 2023-04-01,623032727.0 27 | 2023-04-02,623032756.0 28 | 2023-04-03,623032767.0 29 | 2023-04-04,623032799.0 30 | 2023-04-05,623032843.0 31 | 2023-04-06,623032890.0 32 | 2023-04-07,623032934.0 33 | 2023-04-08,623032954.0 34 | 2023-04-09,623032959.0 35 | 2023-04-10,623032964.0 36 | 2023-04-11,623032997.0 37 | 2023-04-12,623033041.0 38 | 2023-04-13,623033062.0 39 | 2023-04-14,623033095.0 40 | 2023-04-15,623033122.0 41 | 2023-04-16,623033163.0 42 | 2023-04-17,623033190.0 43 | 2023-04-18,623033227.0 44 | 2023-04-19,623033258.0 45 | 2023-04-20,623033294.0 46 | 2023-04-21,623033329.0 47 | 2023-04-22,623033361.0 48 | 2023-04-23,623033385.0 49 | 2023-04-24,623033397.0 50 | 2023-04-25,623033419.0 51 | 2023-04-26,623033440.0 52 | 2023-04-27,623033482.0 53 | 2023-04-28,623033535.0 54 | 2023-04-29,623033575.0 55 | 2023-04-30,623033600.0 56 | 2023-05-01,623033610.0 57 | 2023-05-02,623033632.0 58 | 2023-05-03,623033666.0 59 | 2023-05-04,623033704.0 60 | 2023-05-05,623033714.0 61 | 2023-05-06,623033752.0 62 | 2023-05-07,623033760.0 63 | 2023-05-08,623033769.0 64 | 2023-05-09,623033784.0 65 | 2023-05-10,623033823.0 66 | 2023-05-11,623033853.0 67 | 2023-05-12,623034010.0 68 | 2023-05-13,623034041.0 69 | 2023-05-14,623034060.0 70 | 2023-05-15,623034068.0 71 | 2023-05-16,623034084.0 72 | -------------------------------------------------------------------------------- /python/prophet/tests/test_utilities.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | import numpy as np 7 | 8 | from prophet import Prophet 9 | from prophet.utilities import regressor_coefficients 10 | 11 | 12 | class TestUtilities: 13 | def test_regressor_coefficients(self, daily_univariate_ts, backend): 14 | m = Prophet(stan_backend=backend) 15 | df = daily_univariate_ts.copy() 16 | np.random.seed(123) 17 | df["regr1"] = np.random.normal(size=df.shape[0]) 18 | df["regr2"] = np.random.normal(size=df.shape[0]) 19 | m.add_regressor("regr1", mode="additive") 20 | m.add_regressor("regr2", mode="multiplicative") 21 | m.fit(df) 22 | 23 | coefs = regressor_coefficients(m) 24 | assert coefs.shape == (2, 6) 25 | # No MCMC sampling, so lower and upper should be the same as mean 26 | assert np.array_equal(coefs["coef_lower"].values, coefs["coef"].values) 27 | assert np.array_equal(coefs["coef_upper"].values, coefs["coef"].values) 28 | -------------------------------------------------------------------------------- /python/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools>=64", 4 | "wheel", 5 | "cmdstanpy>=1.0.4", 6 | ] 7 | build-backend = "setuptools.build_meta" 8 | 9 | [project] 10 | name = "prophet" 11 | dynamic = ["version"] 12 | description = "Automatic Forecasting Procedure" 13 | readme = "README.md" 14 | requires-python = ">=3.7" 15 | dependencies = [ 16 | "cmdstanpy>=1.0.4", 17 | "numpy>=1.15.4", 18 | "matplotlib>=2.0.0", 19 | "pandas>=1.0.4", 20 | "holidays>=0.25,<1", 21 | "tqdm>=4.36.1", 22 | "importlib_resources", 23 | ] 24 | authors = [ 25 | {name = "Sean J. Taylor", email = "sjtz@pm.me"}, 26 | {name = "Ben Letham", email = "bletham@fb.com"}, 27 | ] 28 | maintainers = [ 29 | {name = "Cuong Duong", email = "cuong.duong242@gmail.com"}, 30 | ] 31 | license = {text = "MIT"} 32 | classifiers = [ 33 | "Programming Language :: Python", 34 | "Programming Language :: Python :: 3", 35 | "Programming Language :: Python :: 3.7", 36 | "Programming Language :: Python :: 3.8", 37 | "Programming Language :: Python :: 3.9", 38 | "Programming Language :: Python :: 3.10", 39 | "Programming Language :: Python :: 3.11", 40 | ] 41 | 42 | [project.optional-dependencies] 43 | dev = [ 44 | "setuptools>=64", 45 | "wheel", 46 | "pytest", 47 | "jupyterlab", 48 | "nbconvert", 49 | "plotly", 50 | ] 51 | parallel = [ 52 | "dask[dataframe]", 53 | "distributed", 54 | ] 55 | 56 | [project.urls] 57 | Homepage = "https://facebook.github.io/prophet/" 58 | Documentation = "https://facebook.github.io/prophet/" 59 | Repository = "https://github.com/facebook/prophet" 60 | -------------------------------------------------------------------------------- /python_shim/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Facebook, Inc. and its affiliates. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /python_shim/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include requirements.txt 3 | 4 | include fbprophet/tests/DATA.csv 5 | -------------------------------------------------------------------------------- /python_shim/README.md: -------------------------------------------------------------------------------- 1 | # Prophet: Automatic Forecasting Procedure 2 | 3 | As of v1.0, Prophet has moved to use the name "[prophet](https://pypi.org/project/prophet/)" on PyPI and not the original name of "fbprophet". This package is now just a shim for using the prophet package. Please change references in your code to use "prophet" instead of "fbprophet". 4 | 5 | See https://facebook.github.io/prophet/ for full documentation. 6 | -------------------------------------------------------------------------------- /python_shim/fbprophet/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | import logging 7 | 8 | from prophet.forecaster import Prophet 9 | 10 | logger = logging.getLogger('fbprophet') 11 | 12 | logger.warning( 13 | 'As of v1.0, the package name has changed from "fbprophet" to "prophet". ' 14 | 'Please update references in your code accordingly.' 15 | ) 16 | -------------------------------------------------------------------------------- /python_shim/fbprophet/diagnostics.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from prophet.diagnostics import * 7 | -------------------------------------------------------------------------------- /python_shim/fbprophet/forecaster.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from prophet.forecaster import * 7 | -------------------------------------------------------------------------------- /python_shim/fbprophet/make_holidays.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from prophet.make_holidays import * 7 | -------------------------------------------------------------------------------- /python_shim/fbprophet/models.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from prophet.models import * 7 | -------------------------------------------------------------------------------- /python_shim/fbprophet/plot.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from prophet.plot import * 7 | -------------------------------------------------------------------------------- /python_shim/fbprophet/serialize.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from prophet.serialize import * 7 | -------------------------------------------------------------------------------- /python_shim/fbprophet/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/prophet/e64606036325bfb225333ef0991e41bdfb66f7c1/python_shim/fbprophet/tests/__init__.py -------------------------------------------------------------------------------- /python_shim/fbprophet/tests/data.csv: -------------------------------------------------------------------------------- 1 | ds,y 2 | 2012-05-18,38.23 3 | 2012-05-21,34.03 4 | 2012-05-22,31.0 5 | 2012-05-23,32.0 6 | 2012-05-24,33.03 7 | 2012-05-25,31.91 8 | 2012-05-29,28.84 9 | 2012-05-30,28.19 10 | 2012-05-31,29.6 11 | 2012-06-01,27.72 12 | 2012-06-04,26.9 13 | 2012-06-05,25.87 14 | 2012-06-06,26.81 15 | 2012-06-07,26.31 16 | 2012-06-08,27.1 17 | 2012-06-11,27.01 18 | 2012-06-12,27.4 19 | 2012-06-13,27.27 20 | 2012-06-14,28.29 21 | 2012-06-15,30.01 22 | 2012-06-18,31.41 23 | 2012-06-19,31.91 24 | 2012-06-20,31.6 25 | 2012-06-21,31.84 26 | 2012-06-22,33.05 27 | 2012-06-25,32.06 28 | 2012-06-26,33.1 29 | 2012-06-27,32.23 30 | 2012-06-28,31.36 31 | 2012-06-29,31.1 32 | 2012-07-02,30.77 33 | 2012-07-03,31.2 34 | 2012-07-05,31.47 35 | 2012-07-06,31.73 36 | 2012-07-09,32.17 37 | 2012-07-10,31.47 38 | 2012-07-11,30.97 39 | 2012-07-12,30.81 40 | 2012-07-13,30.72 41 | 2012-07-16,28.25 42 | 2012-07-17,28.09 43 | 2012-07-18,29.11 44 | 2012-07-19,29.0 45 | 2012-07-20,28.76 46 | 2012-07-23,28.75 47 | 2012-07-24,28.45 48 | 2012-07-25,29.34 49 | 2012-07-26,26.85 50 | 2012-07-27,23.71 51 | 2012-07-30,23.15 52 | 2012-07-31,21.71 53 | 2012-08-01,20.88 54 | 2012-08-02,20.04 55 | 2012-08-03,21.09 56 | 2012-08-06,21.92 57 | 2012-08-07,20.72 58 | 2012-08-08,20.72 59 | 2012-08-09,21.01 60 | 2012-08-10,21.81 61 | 2012-08-13,21.6 62 | 2012-08-14,20.38 63 | 2012-08-15,21.2 64 | 2012-08-16,19.87 65 | 2012-08-17,19.05 66 | 2012-08-20,20.01 67 | 2012-08-21,19.16 68 | 2012-08-22,19.44 69 | 2012-08-23,19.44 70 | 2012-08-24,19.41 71 | 2012-08-27,19.15 72 | 2012-08-28,19.34 73 | 2012-08-29,19.1 74 | 2012-08-30,19.09 75 | 2012-08-31,18.06 76 | 2012-09-04,17.73 77 | 2012-09-05,18.58 78 | 2012-09-06,18.96 79 | 2012-09-07,18.98 80 | 2012-09-10,18.81 81 | 2012-09-11,19.43 82 | 2012-09-12,20.93 83 | 2012-09-13,20.71 84 | 2012-09-14,22.0 85 | 2012-09-17,21.52 86 | 2012-09-18,21.87 87 | 2012-09-19,23.29 88 | 2012-09-20,22.59 89 | 2012-09-21,22.86 90 | 2012-09-24,20.79 91 | 2012-09-25,20.28 92 | 2012-09-26,20.62 93 | 2012-09-27,20.32 94 | 2012-09-28,21.66 95 | 2012-10-01,21.99 96 | 2012-10-02,22.27 97 | 2012-10-03,21.83 98 | 2012-10-04,21.95 99 | 2012-10-05,20.91 100 | 2012-10-08,20.4 101 | 2012-10-09,20.23 102 | 2012-10-10,19.64 103 | -------------------------------------------------------------------------------- /python_shim/fbprophet/tests/test_package.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | import os 7 | from unittest import TestCase 8 | 9 | import pandas as pd 10 | from fbprophet import Prophet 11 | from fbprophet.diagnostics import cross_validation 12 | import fbprophet.plot as plot 13 | 14 | 15 | DATA = pd.read_csv( 16 | os.path.join(os.path.dirname(__file__), 'data.csv'), 17 | parse_dates=['ds'], 18 | ) 19 | 20 | 21 | class TestFbprophet(TestCase): 22 | 23 | def test_shim(self): 24 | m = Prophet() 25 | m.fit(DATA) 26 | future = m.make_future_dataframe(10, include_history=False) 27 | fcst = m.predict(future) 28 | 29 | df_cv = cross_validation( 30 | model=m, horizon='4 days', period='10 days', initial='115 days', 31 | ) 32 | 33 | fig = plot.plot_forecast_component(m=m, fcst=fcst, name='weekly') 34 | -------------------------------------------------------------------------------- /python_shim/requirements.txt: -------------------------------------------------------------------------------- 1 | prophet 2 | -------------------------------------------------------------------------------- /python_shim/setup.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) Facebook, Inc. and its affiliates. 2 | 3 | # This source code is licensed under the MIT license found in the 4 | # LICENSE file in the root directory of this source tree. 5 | 6 | from setuptools import setup, find_packages 7 | 8 | with open('README.md', 'r', encoding='utf-8') as f: 9 | long_description = f.read() 10 | 11 | with open('requirements.txt', 'r') as f: 12 | install_requires = f.read().splitlines() 13 | 14 | setup( 15 | name='fbprophet', 16 | version='1.0.1', 17 | description='Automatic Forecasting Procedure', 18 | url='https://facebook.github.io/prophet/', 19 | author='Sean J. Taylor , Ben Letham ', 20 | author_email='sjtz@pm.me', 21 | license='MIT', 22 | packages=find_packages(), 23 | setup_requires=[], 24 | install_requires=install_requires, 25 | python_requires='>=3', 26 | zip_safe=False, 27 | include_package_data=True, 28 | test_suite='fbprophet.tests', 29 | classifiers=[ 30 | 'Programming Language :: Python', 31 | 'Programming Language :: Python :: 3', 32 | 'Programming Language :: Python :: 3.7', 33 | ], 34 | long_description=long_description, 35 | long_description_content_type='text/markdown', 36 | ) 37 | --------------------------------------------------------------------------------