validate_decomposition.Rdvalidate_decomposition() creates a sample decomposition and errors from a
dataset, a reference decomposition, and decomposition parameters. It is
designed to be used as a mapping function passed to
map() within
cv_decomposition().
validate_decomposition(.i, .data, .ref, period, trend)The index of the sample; all data up to this point will be used
The data to sample
A reference decomposition used to calculate errors
The length of time to use in seasonal decomposition; can be a
time-based definition (e.g. "1 week") or an integer number of days. If
NULL or "auto", period is set automatically using the tunable
heuristics in the timetk package.
The length of time to use in trend decomposition; can be a
time-based definition (e.g. "1 month") or an integer number of days. If
NULL or "auto", trend is set automatically using the tunable
heuristics in the timetk package.
A tibble containing the time index of the data, as well as columns
sample (an indicator of the sample to which the data belongs), horizon,
observed, season, trend, remainder, season_error, trend_error,
and remainder_error