prophet.Rd 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/prophet.R
  3. \name{prophet}
  4. \alias{prophet}
  5. \title{Prophet forecaster.}
  6. \usage{
  7. prophet(df = df, growth = "linear", changepoints = NULL,
  8. n.changepoints = 25, yearly.seasonality = TRUE,
  9. weekly.seasonality = TRUE, holidays = NULL,
  10. seasonality.prior.scale = 10, holidays.prior.scale = 10,
  11. changepoint.prior.scale = 0.05, mcmc.samples = 0, interval.width = 0.8,
  12. uncertainty.samples = 1000, fit = TRUE, ...)
  13. }
  14. \arguments{
  15. \item{df}{Dataframe containing the history. Must have columns ds (date type)
  16. and y, the time series. If growth is logistic, then df must also have a
  17. column cap that specifies the capacity at each ds.}
  18. \item{growth}{String 'linear' or 'logistic' to specify a linear or logistic
  19. trend.}
  20. \item{changepoints}{Vector of dates at which to include potential
  21. changepoints. If not specified, potential changepoints are selected
  22. automatically.}
  23. \item{n.changepoints}{Number of potential changepoints to include. Not used
  24. if input `changepoints` is supplied. If `changepoints` is not supplied,
  25. then n.changepoints potential changepoints are selected uniformly from the
  26. first 80 percent of df$ds.}
  27. \item{yearly.seasonality}{Boolean, fit yearly seasonality.}
  28. \item{weekly.seasonality}{Boolean, fit weekly seasonality.}
  29. \item{holidays}{data frame with columns holiday (character) and ds (date
  30. type)and optionally columns lower_window and upper_window which specify a
  31. range of days around the date to be included as holidays. lower_window=-2
  32. will include 2 days prior to the date as holidays.}
  33. \item{seasonality.prior.scale}{Parameter modulating the strength of the
  34. seasonality model. Larger values allow the model to fit larger seasonal
  35. fluctuations, smaller values dampen the seasonality.}
  36. \item{holidays.prior.scale}{Parameter modulating the strength of the holiday
  37. components model.}
  38. \item{changepoint.prior.scale}{Parameter modulating the flexibility of the
  39. automatic changepoint selection. Large values will allow many changepoints,
  40. small values will allow few changepoints.}
  41. \item{mcmc.samples}{Integer, if great than 0, will do full Bayesian
  42. inference with the specified number of MCMC samples. If 0, will do MAP
  43. estimation.}
  44. \item{interval.width}{Numeric, width of the uncertainty intervals provided
  45. for the forecast. If mcmc.samples=0, this will be only the uncertainty
  46. in the trend using the MAP estimate of the extrapolated generative model.
  47. If mcmc.samples>0, this will be integrated over all model parameters,
  48. which will include uncertainty in seasonality.}
  49. \item{uncertainty.samples}{Number of simulated draws used to estimate
  50. uncertainty intervals.}
  51. \item{fit}{Boolean, if FALSE the model is initialized but not fit.}
  52. \item{...}{Additional arguments, passed to \code{\link{fit.prophet}}}
  53. }
  54. \value{
  55. A prophet model.
  56. }
  57. \description{
  58. Prophet forecaster.
  59. }
  60. \examples{
  61. \dontrun{
  62. history <- data.frame(ds = seq(as.Date('2015-01-01'), as.Date('2016-01-01'), by = 'd'),
  63. y = sin(1:366/200) + rnorm(366)/10)
  64. m <- prophet(history)
  65. }
  66. }