Description Usage Arguments Value Examples
View source: R/HELPER_force_to_uniseasonal_ts_object.R
force_to_uniseasonal_ts_object
is a function to transform a time
series object into a uniseasonal time series object. This is needed to run
i.a. the linear forecasting functions, since they require a uniseasonal time
series object as an input.
1 | force_to_uniseasonal_ts_object(ts_object)
|
ts_object |
A time series object that can be uniseasonal or multiseasonal. |
A uniseasonal time series object. If the original ts_object was multiseasonal, then the highest seasonality is selected.
1 2 3 4 5 6 7 8 9 10 | 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") %>%
tstools::transform_data_to_ts_object(seasonal_periods = c(12,3))
force_to_uniseasonal_ts_object(ts_object = ts_object)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.