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] 1120.0000 1160.0000  963.0000 1210.0000 1175.8064 1162.1145 1146.9693
#>   [8] 1130.5225 1114.1188 1100.0915 1089.0667 1066.2115 1041.2341 1022.1460
#>  [15] 1012.3943 1013.1067 1021.4625 1036.4801 1056.7835 1081.3630 1111.2865
#>  [22] 1143.1279 1166.6096 1170.3679 1150.8588 1113.8123 1065.0840 1008.5282
#>  [29]  953.0976  904.3145  864.9390  838.8615  824.9269  828.8281  845.4319
#>  [36]  866.0663  880.3252  882.2877  877.8633  867.0360  850.6106  836.9494
#>  [43]  831.1548  830.7648  832.8181  834.5173  839.4796  845.8713  851.7685
#>  [50]  856.0555  823.0238  821.5475  818.6506  815.9139  809.4039  792.6078
#>  [57]  783.1336  779.5468  781.0009  791.7159  806.1656  838.1100  878.1540
#>  [64]  899.5269  904.1766  894.3702  859.3017  807.7231  767.3653  751.4421
#>  [71]  749.7783  756.3982  777.6021  803.6640  820.0039  833.5015  847.2809
#>  [78]  861.9660  875.2325  886.7695  717.4173  787.5232  855.7370  908.9154
#>  [85]  941.1988  923.7201  916.3680  909.3547  916.4543  933.6553  924.2481
#>  [92]  924.5265  915.5584  891.0688  871.3603  848.1136  798.0301  767.6580
#>  [99]  739.5270  712.9395

Smoothing(timeseries = runif(n = 50, min = 1, max = 10), breaks = c(4, 20, 30))
#>  [1] 7.298464 2.980003 7.551918 2.953760 4.747184 4.911036 4.662583 4.657151
#>  [9] 5.777574 8.208536 9.224494 8.978117 8.083902 7.607224 8.031155 8.584173
#> [17] 6.884181 4.494536 4.521065 7.145432 8.799541 3.146078 1.040467 9.491648
#> [25] 4.943235 7.755430 7.010342 4.671759 4.161239 7.642824 5.631466 5.324776
#> [33] 4.957515 5.266540 4.789999 4.617750 4.428589 4.604423 5.010180 5.658568
#> [41] 5.428907 5.703117 6.257736 6.524101 6.768329 7.032209 6.676569 7.100549
#> [49] 7.798273 8.318584