knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-images/",
  message = FALSE
)
Sys.setlocale("LC_TIME", "C")

prophetExt

Travis-CI Build Status CRAN_Status_Badge

Extension for Facebook Prophet.

Installation

You can install prophetExt from github with:

# install.packages("devtools")
devtools::install_github("hoxo-m/prophetExt")

or

# install.packages("githubinstall")
githubinstall::githubinstall("prophetExt")

Example

Ready data.

df <- read.csv("https://raw.githubusercontent.com/facebook/prophet/master/examples/example_wp_peyton_manning.csv")
df$y <- log(df$y)

Fit model.

library(prophet)
m <- prophet(df, daily.seasonality = FALSE)

Change Points

Pick changepoints.

library(prophetExt)
cpts <- prophet_pick_changepoints(m)
head(cpts)

Draw changepoints.

future <- make_future_dataframe(m, 365)
fore <- predict(m, future)
plot(m, fore) + autolayer(cpts)

Outliers

Detect outliers.

outliers <- prophet_detect_outliers(m)
head(outliers)

Draw outliers.

plot(m, fore) + autolayer(outliers)

Draw outliers using calendar plot.

prophet_calendar_plot(outliers)

SHF (Simulated Historical Forcast)

shf <- prophet_shf(m, periods = 365)
head(shf$estimated)
plot(shf)


hoxo-m/prophetExt documentation built on Jan. 18, 2021, 11:12 a.m.