prophet.Rd 3.6 KB

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