Skip to contents

Prophet-style additive decomposition (linear trend + Fourier seasonality)

Usage

morie_prophet_components(x, period = 12)

Arguments

x

Numeric univariate series.

period

Seasonal period. Default 12.

Value

Named list with trend, seasonal, residual, slope, intercept, fourier_terms, period, n, method.

Examples

morie_prophet_components(x = rnorm(50))
#> $trend
#>             1             2             3             4             5 
#> -0.0370008158 -0.0362000025 -0.0353991891 -0.0345983758 -0.0337975625 
#>             6             7             8             9            10 
#> -0.0329967492 -0.0321959358 -0.0313951225 -0.0305943092 -0.0297934958 
#>            11            12            13            14            15 
#> -0.0289926825 -0.0281918692 -0.0273910558 -0.0265902425 -0.0257894292 
#>            16            17            18            19            20 
#> -0.0249886158 -0.0241878025 -0.0233869892 -0.0225861758 -0.0217853625 
#>            21            22            23            24            25 
#> -0.0209845492 -0.0201837358 -0.0193829225 -0.0185821092 -0.0177812958 
#>            26            27            28            29            30 
#> -0.0169804825 -0.0161796692 -0.0153788559 -0.0145780425 -0.0137772292 
#>            31            32            33            34            35 
#> -0.0129764159 -0.0121756025 -0.0113747892 -0.0105739759 -0.0097731625 
#>            36            37            38            39            40 
#> -0.0089723492 -0.0081715359 -0.0073707225 -0.0065699092 -0.0057690959 
#>            41            42            43            44            45 
#> -0.0049682825 -0.0041674692 -0.0033666559 -0.0025658425 -0.0017650292 
#>            46            47            48            49            50 
#> -0.0009642159 -0.0001634026  0.0006374108  0.0014382241  0.0022390374 
#> 
#> $seasonal
#>  [1]  0.67603838  0.24680232 -0.04099563  0.12933868 -0.03966967 -0.48014345
#>  [7] -0.33055416  0.77256834 -0.36042838  0.62007558  0.09560947 -1.28864147
#> [13]  0.67603838  0.24680232 -0.04099563  0.12933868 -0.03966967 -0.48014345
#> [19] -0.33055416  0.77256834 -0.36042838  0.62007558  0.09560947 -1.28864147
#> [25]  0.67603838  0.24680232 -0.04099563  0.12933868 -0.03966967 -0.48014345
#> [31] -0.33055416  0.77256834 -0.36042838  0.62007558  0.09560947 -1.28864147
#> [37]  0.67603838  0.24680232 -0.04099563  0.12933868 -0.03966967 -0.48014345
#> [43] -0.33055416  0.77256834 -0.36042838  0.62007558  0.09560947 -1.28864147
#> [49]  0.67603838  0.24680232
#> 
#> $residual
#>           1           2           3           4           5           6 
#>  0.57096639 -0.96358297 -0.57287242 -0.34898475 -1.22290233  0.08848310 
#>           7           8           9          10          11          12 
#> -0.03640563 -0.68129830  1.07170056  0.97913967  0.74469223  0.04556542 
#>          13          14          15          16          17          18 
#>  0.85602856  0.58677502  0.13136204  1.23970365  0.60575524  0.34946539 
#>          19          20          21          22          23          24 
#> -0.22919131  0.13580566 -1.82974404 -0.75478013 -1.20334000 -0.71289345 
#>          25          26          27          28          29          30 
#> -0.43563008 -0.35772496 -1.96686984 -0.39363870  0.47487837  1.13680561 
#>          31          32          33          34          35          36 
#>  0.63791196 -0.04125100  0.56430787 -0.24206197 -0.19923523  0.26102021 
#>          37          38          39          40          41          42 
#> -0.41527568  0.68311382  2.32250149 -0.56500825  0.05638998 -1.64268216 
#>          43          44          45          46          47          48 
#> -0.45819375  0.51881559  0.10785688 -0.05022563  0.57200426  0.33837977 
#>          49          50 
#> -0.66196793 -0.01650896 
#> 
#> $slope
#> [1] 0.0008008133
#> 
#> $intercept
#> [1] -0.03700082
#> 
#> $fourier_terms
#>          X1          X2          X3          X4          X5          X6 
#> -0.03164820  0.01307365  0.33642081 -0.10098251  0.12891149  0.09198011 
#>          X7          X8          X9         X10 
#>  0.46845037  0.27372462 -0.08480877  0.39824251 
#> 
#> $period
#> [1] 12
#> 
#> $n
#> [1] 50
#> 
#> $method
#> [1] "Prophet-style linear-trend + Fourier(K=5) seasonality"
#>