Augment tsibble with usual regressors

augment_tsibble_4_regression(original, target = "value", h = 1)

Arguments

original

original tsibble

target

name of the target variable

h

forecasting horizon h rows to append in the future, corresponding lags will be added to tsibble

Value

augmented tibble

Details

Augment tsibble with usual regressors. Adds trend, fourier terms, lags of regressor and dependen variables. Also appends h rows for forecasting.

Examples

test_ts = stats::ts(rnorm(100), start = c(2000, 1), freq = 12) test_tsibble = tsibble::as_tsibble(test_ts) augment_tsibble_4_regression(test_tsibble, h = 4)
#> # A tsibble: 104 x 19 [1M] #> index value trend_lin trend_root s1_12 c1_12 s2_12 c2_12 s3_12 c3_12 #> <mth> <dbl> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 2000 янв -0.150 1 1 0.500 0.866 0.866 0.5 1 0 #> 2 2000 фев -1.71 2 1.41 0.866 0.5 0.866 -0.500 0 -1 #> 3 2000 мар 1.43 3 1.73 1 0 0 -1 -1 0 #> 4 2000 апр -2.65 4 2 0.866 -0.500 -0.866 -0.5 0 1 #> 5 2000 мая -1.03 5 2.24 0.5 -0.866 -0.866 0.500 1 0 #> 6 2000 июн -0.707 6 2.45 0 -1 0 1 0 -1 #> 7 2000 июл -0.701 7 2.65 -0.500 -0.866 0.866 0.5 -1 0 #> 8 2000 авг 0.538 8 2.83 -0.866 -0.5 0.866 -0.500 0 1 #> 9 2000 сен -0.316 9 3 -1 0 0 -1 1 0 #> 10 2000 окт -0.840 10 3.16 -0.866 0.500 -0.866 -0.5 0 -1 #> # … with 94 more rows, and 9 more variables: s4_12 <dbl>, c4_12 <dbl>, #> # s5_12 <dbl>, c5_12 <dbl>, c6_12 <dbl>, lag4_value <dbl>, lag5_value <dbl>, #> # lag12_value <dbl>, lag13_value <dbl>