cleanup_multivariate_ts_object: Cleans a multivariate time series object

Description Usage Arguments Value Examples

View source: R/HELPER_cleanup_multivariate_ts_object.R

Description

cleanup_multivariate_ts_object is a function to clean a multivariate time series object by removing all unnecessary columns (e.g. original_col_of_interest). This is needed to make sure that no information besides the external regressors is used when training the forecast models.

Usage

1

Arguments

ts_object

A multivariate time series object

Value

A cleaned multivariate time series object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ts_object <- tstools::initialize_ts_forecast_data(
      data = dummy_gasprice,
      date_col = "year_month",
      col_of_interest = "gasprice",
      group_cols = c("state", "oil_company"),
      xreg_cols = c("spotprice", "gemprice")
   ) %>%
   dplyr::filter(grouping == "state = New York   &   oil_company = CompanyA") %>%
   dplyr::mutate(original_col_of_interest = col_of_interest) %>% 
   tstools::transform_data_to_ts_object(seasonal_periods = c(12,3))
cleanup_multivariate_ts_object(ts_object = ts_object)

ing-bank/tsforecast documentation built on Sept. 18, 2020, 9:40 a.m.