2017-08-26 21:31:33 +00:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
|
|
|
|
% Please edit documentation in R/diagnostics.R
|
|
|
|
|
\name{cross_validation}
|
|
|
|
|
\alias{cross_validation}
|
2017-09-02 17:53:38 +00:00
|
|
|
\title{Cross-validation for time series.}
|
2017-08-26 21:31:33 +00:00
|
|
|
\usage{
|
2017-09-02 17:53:38 +00:00
|
|
|
cross_validation(model, horizon, units, period = NULL, initial = NULL)
|
2017-08-26 21:31:33 +00:00
|
|
|
}
|
|
|
|
|
\arguments{
|
|
|
|
|
\item{model}{Fitted Prophet model.}
|
|
|
|
|
|
|
|
|
|
\item{horizon}{Integer size of the horizon}
|
|
|
|
|
|
|
|
|
|
\item{units}{String unit of the horizon, e.g., "days", "secs".}
|
|
|
|
|
|
|
|
|
|
\item{period}{Integer amount of time between cutoff dates. Same units as
|
2017-09-02 17:53:38 +00:00
|
|
|
horizon. If not provided, 0.5 * horizon is used.}
|
2017-08-26 21:31:33 +00:00
|
|
|
|
|
|
|
|
\item{initial}{Integer size of the first training period. If not provided,
|
|
|
|
|
3 * horizon is used. Same units as horizon.}
|
|
|
|
|
}
|
|
|
|
|
\value{
|
|
|
|
|
A dataframe with the forecast, actual value, and cutoff date.
|
|
|
|
|
}
|
|
|
|
|
\description{
|
2018-05-30 19:09:54 +00:00
|
|
|
Computes forecasts from historical cutoff points. Beginning from
|
|
|
|
|
(end - horizon), works backwards making cutoffs with a spacing of period
|
|
|
|
|
until initial is reached.
|
2017-09-02 17:53:38 +00:00
|
|
|
}
|
|
|
|
|
\details{
|
|
|
|
|
When period is equal to the time interval of the data, this is the
|
|
|
|
|
technique described in https://robjhyndman.com/hyndsight/tscv/ .
|
2017-08-26 21:31:33 +00:00
|
|
|
}
|