prophet.Rd 3.2 KB

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