cross_validation.Rd 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  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. Computes forecast error with cutoffs at the specified period. When the
  7. period is the time interval of the data, is the procedure described in
  8. https://robjhyndman.com/hyndsight/tscv/. Beginning from end-horizon, makes
  9. a cutoff every "period" amount of time, going back to "initial".}
  10. \usage{
  11. cross_validation(model, horizon, units, period, initial = NULL)
  12. }
  13. \arguments{
  14. \item{model}{Fitted Prophet model.}
  15. \item{horizon}{Integer size of the horizon}
  16. \item{units}{String unit of the horizon, e.g., "days", "secs".}
  17. \item{period}{Integer amount of time between cutoff dates. Same units as
  18. horizon.}
  19. \item{initial}{Integer size of the first training period. If not provided,
  20. 3 * horizon is used. Same units as horizon.}
  21. }
  22. \value{
  23. A dataframe with the forecast, actual value, and cutoff date.
  24. }
  25. \description{
  26. Cross-validation for time series.
  27. Computes forecast error with cutoffs at the specified period. When the
  28. period is the time interval of the data, is the procedure described in
  29. https://robjhyndman.com/hyndsight/tscv/. Beginning from end-horizon, makes
  30. a cutoff every "period" amount of time, going back to "initial".
  31. }