tsl <- tsl_simulate(n = 2)
#rolling window smoothing
tsl_smooth <- tsl_smooth(
tsl = tsl,
window = 5,
f = mean
)
if(interactive()){
tsl_plot(tsl)
tsl_plot(tsl_smooth)
}
#exponential smoothing
tsl_smooth <- tsl_smooth(
tsl = tsl,
alpha = 0.2
)
if(interactive()){
tsl_plot(tsl)
tsl_plot(tsl_smooth)
}
Run the code above in your browser using DataLab