Add fourier terms to tsibble

add_fourier(original, K_fourier = Inf)

Arguments

original

original tsibble

K_fourier

number of fourier terms

Value

tsibble with fourier terms

Details

Add fourier terms to tsibble

Examples

test_ts = stats::ts(rnorm(100), start = c(2000, 1), freq = 12) test_tsibble = tsibble::as_tsibble(test_ts) add_fourier(test_tsibble)
#> Registered S3 method overwritten by 'quantmod': #> method from #> as.zoo.data.frame zoo
#> # A tsibble: 100 x 13 [1M] #> index value s1_12 c1_12 s2_12 c2_12 s3_12 c3_12 s4_12 c4_12 #> <mth> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 2000 янв -1.40 0.500 0.866 0.866 0.5 1 0 0.866 -0.500 #> 2 2000 фев 0.255 0.866 0.5 0.866 -0.500 0 -1 -0.866 -0.5 #> 3 2000 мар -2.44 1 0 0 -1 -1 0 0 1 #> 4 2000 апр -0.00557 0.866 -0.500 -0.866 -0.5 0 1 0.866 -0.500 #> 5 2000 мая 0.622 0.5 -0.866 -0.866 0.500 1 0 -0.866 -0.5 #> 6 2000 июн 1.15 0 -1 0 1 0 -1 0 1 #> 7 2000 июл -1.82 -0.500 -0.866 0.866 0.5 -1 0 0.866 -0.500 #> 8 2000 авг -0.247 -0.866 -0.5 0.866 -0.500 0 1 -0.866 -0.5 #> 9 2000 сен -0.244 -1 0 0 -1 1 0 0 1 #> 10 2000 окт -0.283 -0.866 0.500 -0.866 -0.5 0 -1 0.866 -0.500 #> # … with 90 more rows, and 3 more variables: s5_12 <dbl>, c5_12 <dbl>, #> # c6_12 <dbl>