Prophet has two implementations: R and Python.

Installation in R

Prophet is a CRAN package so you can use install.packages.

1
2
# R
install.packages('prophet')

After installation, you can get started!

Experimental backend - cmdstanr

You can also choose an experimental alternative stan backend called cmdstanr. Once you’ve installed prophet, follow these instructions to use cmdstanr instead of rstan as the backend:

1
2
3
4
5
6
7
8
9
10
11
# R
# We recommend running this is a fresh R session or restarting your current session
install.packages(c("cmdstanr", "posterior"), repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

# If you haven't installed cmdstan before, run:
cmdstanr::install_cmdstan()
# Otherwise, you can point cmdstanr to your cmdstan path:
cmdstanr::set_cmdstan_path(path = <your existing cmdstan>)

# Set the R_STAN_BACKEND environment variable
Sys.setenv(R_STAN_BACKEND = "CMDSTANR")

Windows

On Windows, R requires a compiler so you’ll need to follow the instructions provided by rstan. The key step is installing Rtools before attempting to install the package.

If you have custom Stan compiler settings, install from source rather than the CRAN binary.

Installation in Python

Prophet is on PyPI, so you can use pip to install it.

1
python -m pip install prophet
  • From v0.6 onwards, Python 2 is no longer supported.
  • As of v1.0, the package name on PyPI is “prophet”; prior to v1.0 it was “fbprophet”.
  • As of v1.1, the minimum supported Python version is 3.7.

After installation, you can get started!

Anaconda

Prophet can also be installed through conda-forge.

1
conda install -c conda-forge prophet

Edit on GitHub