Skip to contents

Smoothening of the time series

Usage

Smoothing(timeseries, frequency = 52, smoothening_algorithm = "lowess", breaks)

Arguments

timeseries

Given time series

frequency

Timeseries frequency, defaults to 12 points

smoothening_algorithm

Smoothening algorithm required

breaks

Breakpoints identified by the previous algorithm

lowess

Lowess smoothener

Value

The smoothened time series

Examples

Smoothing(timeseries = StructuralDecompose::Nile_dataset[,1], breaks = c(4, 50, 80))
#>  [1] 1124.7002 1120.0555 1115.7059 1111.6474 1107.8713 1104.3873 1101.1868
#>  [8] 1098.2216 1095.4193 1092.7045 1090.0057 1087.2377 1084.3165 1081.2022
#> [15] 1078.0712 1075.6112 1069.9872 1062.6761 1054.0972 1044.8792 1035.0753
#> [22] 1024.7443 1014.1921 1003.6909  993.0625  981.6105  968.5932  953.7479
#> [29]  937.2038  919.7212  902.8152  887.8188  881.5851  876.3718  871.3876
#> [36]  866.6127  862.0841  857.7852  853.6761  849.7266  845.9306  842.3033
#> [43]  838.8655  835.6435  832.6302  829.7861  827.0713  798.9009  801.9204
#> [50]  805.3126  809.1336  813.3608  817.8961  822.6373  827.4037  831.9377
#> [57]  836.0001  841.8590  846.5545  849.2619  849.4481  847.4104  843.9194
#> [64]  839.6215  835.5942  832.3450  829.0320  825.4557  828.2389  830.8036
#> [71]  833.5662  836.8415  840.8017  845.5189  850.9551  857.0311  863.6528

Smoothing(timeseries = runif(n = 50, min = 1, max = 10), breaks = c(4, 20, 30))
#>  [1] 7.530115 7.235390 6.915934 6.570732 6.208344 5.852731 5.293361 4.679367
#>  [9] 4.007346 3.295271 2.689716 2.582901 3.584005 4.315581 5.012974 5.758579
#> [17] 6.565607 4.243420 4.110548 3.845342 4.394352 5.418816 6.846615 8.466742
#> [25] 9.020588 8.640066 8.178374