cross_validation.Rd 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/diagnostics.R
  3. \name{cross_validation}
  4. \alias{cross_validation}
  5. \title{Cross-validation for time series.}
  6. \usage{
  7. cross_validation(model, horizon, units, period = NULL, initial = NULL)
  8. }
  9. \arguments{
  10. \item{model}{Fitted Prophet model.}
  11. \item{horizon}{Integer size of the horizon}
  12. \item{units}{String unit of the horizon, e.g., "days", "secs".}
  13. \item{period}{Integer amount of time between cutoff dates. Same units as
  14. horizon. If not provided, 0.5 * horizon is used.}
  15. \item{initial}{Integer size of the first training period. If not provided,
  16. 3 * horizon is used. Same units as horizon.}
  17. }
  18. \value{
  19. A dataframe with the forecast, actual value, and cutoff date.
  20. }
  21. \description{
  22. Computes forecasts from historical cutoff points. Beginning from initial,
  23. makes cutoffs with a spacing of period up to (end - horizon).
  24. }
  25. \details{
  26. When period is equal to the time interval of the data, this is the
  27. technique described in https://robjhyndman.com/hyndsight/tscv/ .
  28. }