rt_ts_lm_build_formula | R Documentation |
returns a forumla string to pass 'tslm()“
rt_ts_lm_build_formula( dependent_variable, independent_variables = NULL, interaction_variables = NULL, ex_ante_forecast_horizon = NULL )
dependent_variable |
name of the depedent variable in the dataset |
independent_variables |
name of the indepedent variables in the dataset (including "trend" & "season" if applicable) |
interaction_variables |
not supported yet |
ex_ante_forecast_horizon |
is used when the regression model will be used to forecast future values, 'ex_ante_forecast_horizon' specifies the number periods (i.e. horizon) that will be forecasted. Ex ante means the forecast will be a "true" forecast and, in this case, will only use lagged values that are lagged far enough back, that we can use them to predict into the future. (and/or trend/season variables) For example, if we want to lag 4 periods (e.g. quarters) ahead, we must use values that are lagged 4 periods behind. Lagged variables must be in the for of 'x_lag_y', where 'x' is the original variable name and 'y' is the lag number. If 'ex_ante_forecast_horizon' is set, only variables that are in the form of 'x_lag_y' will be included, and additionally, only lagged variables where 'y' >= 'ex_ante_forecast_horizon' will be included. All independent variables are included of 'ex_ante_forecast_horizon' is 'NULL' |
rt_ts_lm_build_formula(dependent_variable = 'dataset', independent_variables = c('trend', 'season'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.