Skip to the content.

Forecasting examples in R: orange juice retail sales

The Rmarkdown notebooks in this directory are as follows. Each notebook also has a corresponding HTML file, which is the rendered output from running the code. This is best viewed on our https://microsoft.github.io/forecasting/ GitHub Page.

If you want to run the code in the notebooks interactively, you must start from 01_dataprep.Rmd and proceed in sequence, as the earlier notebooks will generate artifacts (datasets/model objects) that are used by later ones.

Package installation

The following packages are needed to run the basic analysis notebooks in this directory:

It’s likely that you will already have many of these (particularly the Tidyverse packages) installed, if you use R for data science tasks. The main exceptions are the packages in the Tidyverts family, which is a modern framework for time series analysis building on the Tidyverse.

install.packages("tidyverse") # installs all tidyverse packages
install.packages("rmarkdown")
install.packages("here")
install.packages(c("tsibble", "fable", "feasts", "urca"))

The following packages are needed to run the Prophet analysis notebook:

While prophet is available from CRAN, its frontend for the tidyverts framework, fable.prophet, is currently on GitHub only. You can install these packages with

install.packages("prophet")
install.packages("https://github.com/mitchelloharawild/fable.prophet/archive/master.tar.gz", repos=NULL)