Skip to contents

This is a boilerplate function to create automatically the following:

  • recipe

  • model specification

  • workflow

  • calibration tibble and plot

Usage

ts_auto_theta(
  .data,
  .date_col,
  .value_col,
  .rsamp_obj,
  .prefix = "ts_theta",
  .bootstrap_final = FALSE
)

Arguments

.data

The data being passed to the function. The time-series object.

.date_col

The column that holds the datetime.

.value_col

The column that has the value

.rsamp_obj

The splits object

.prefix

Default is ts_theta

.bootstrap_final

Not yet implemented.

Value

A list

Details

This uses the forecast::thetaf() for the parsnip engine. This model does not use exogenous regressors, so only a univariate model of: value ~ date will be used from the .date_col and .value_col that you provide.

Author

Steven P. Sanderson II, MPH

Examples

if (FALSE) {
library(dplyr)

data <- AirPassengers %>%
  ts_to_tbl() %>%
  select(-index)

splits <- time_series_split(
  data
  , date_col
  , assess = 12
  , skip = 3
  , cumulative = TRUE
)

ts_theta <- ts_auto_theta(
  .data = data,
  .date_col = date_col,
  .value_col = value,
  .rsamp_obj = splits
)

ts_theta$recipe_info
}