cross_validation: Cross-validation for time series.

Description Usage Arguments Details Value

View source: R/diagnostics.R

Description

Computes forecasts from historical cutoff points which user can input.If not provided, these are computed beginning from (end - horizon), and working backwards making cutoffs with a spacing of period until initial is reached.

Usage

1
2
3
4
5
6
7
8
cross_validation(
  model,
  horizon,
  units,
  period = NULL,
  initial = NULL,
  cutoffs = NULL
)

Arguments

model

Fitted Prophet model.

horizon

Integer size of the horizon

units

String unit of the horizon, e.g., "days", "secs".

period

Integer amount of time between cutoff dates. Same units as horizon. If not provided, 0.5 * horizon is used.

initial

Integer size of the first training period. If not provided, 3 * horizon is used. Same units as horizon.

cutoffs

Vector of cutoff dates to be used during cross-validtation. If not provided works beginning from (end - horizon), works backwards making cutoffs with a spacing of period until initial is reached.

Details

When period is equal to the time interval of the data, this is the technique described in https://robjhyndman.com/hyndsight/tscv/ .

Value

A dataframe with the forecast, actual value, and cutoff date.


prophet documentation built on March 30, 2021, 5:05 p.m.