prophet.Rd 3.9 KB

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