plot.prophet: Plot the prophet forecast.

Description Usage Arguments Value Examples

View source: R/plot.R

Description

Plot the prophet forecast.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'prophet'
plot(
  x,
  fcst,
  uncertainty = TRUE,
  plot_cap = TRUE,
  xlabel = "ds",
  ylabel = "y",
  ...
)

Arguments

x

Prophet object.

fcst

Data frame returned by predict(m, df).

uncertainty

Optional boolean indicating if the uncertainty interval for yhat should be plotted, which will only be done if x$uncertainty.samples > 0. Must be present in fcst as yhat_lower and yhat_upper.

plot_cap

Boolean indicating if the capacity should be shown in the figure, if available.

xlabel

Optional label for x-axis

ylabel

Optional label for y-axis

...

additional arguments

Value

A ggplot2 plot.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
history <- data.frame(ds = seq(as.Date('2015-01-01'), as.Date('2016-01-01'), by = 'd'),
                      y = sin(1:366/200) + rnorm(366)/10)
m <- prophet(history)
future <- make_future_dataframe(m, periods = 365)
forecast <- predict(m, future)
plot(m, forecast)

## End(Not run)

prophet documentation built on March 30, 2021, 5:05 p.m.