Description Usage Arguments Value Examples
View source: R/HELPER_get_fc_periods.R
get_fc_periods
is a function which creates a vector of periods to be
forecasted given the training data and intended forecasting periods ahead.
1 | get_fc_periods(ts_object_train, periods_ahead)
|
ts_object_train |
A time series object, representing the training data for the forecast. |
periods_ahead |
A positive integer value indicating the number of periods ahead to be forecasted (e.g. 24 for 2 years ahead forecasting using monthly data). |
A vector of periods in numeric yyyymm format, of length periods_ahead and starting after the periods available in ts_object_train.
1 2 3 4 5 6 7 8 9 10 | ts_object_train <- 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 = 3)
get_fc_periods(ts_object_train = ts_object_train, periods_ahead = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.