https://github.com/viraltux/smoothers.jl
Collection of basic smoothers and smoothing related applications
https://github.com/viraltux/smoothers.jl
decomposition filter hma julia loess sma smoothing stl time-series
Last synced: 10 months ago
JSON representation
Collection of basic smoothers and smoothing related applications
- Host: GitHub
- URL: https://github.com/viraltux/smoothers.jl
- Owner: viraltux
- License: mit
- Created: 2021-08-15T22:36:10.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T15:28:43.000Z (almost 3 years ago)
- Last Synced: 2025-08-01T03:18:43.291Z (10 months ago)
- Topics: decomposition, filter, hma, julia, loess, sma, smoothing, stl, time-series
- Language: Julia
- Homepage:
- Size: 369 KB
- Stars: 17
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Smoothers
The package Smoothers provides a collection of smoothing heuristics, models and smoothing related applications. The current available smoothers and applications are:
* Henderson Moving Average Filter (**hma**)
* Linear Time-invariant Difference Equation Filter — Matlab/Octave (**filter**)
* Locally Estimated Scatterplot Smoothing (**loess**)
* Seasonal and Trend decomposition based on Loess (**stl**)
* Simple Moving Average (**sma**)

## Quick Examples
```julia
using Smoothers, Plots
t = Array(LinRange(-pi,pi,100));
x = sin.(t) .+ 0.25*rand(length(t));
# Data
w = 21; sw = string(w)
plot(t,x,label="sin(t)+ϵ",linewidth=10,alpha=.3,
xlabel = "t", ylabel = "x",
title="Smoothers",legend=:bottomright)
# Henderson Moving Average Filter
plot!(t,hma(x,w), label ="hma(x,"*sw*")")
# Locally Estimated Scatterplot Smoothing
plot!(t,loess(t,x;q=w)(t), label ="loess(t,x;q="*sw*")(t)")
# Moving Average Filter with Matlab/Octave 'filter'
b = ones(w)/w; a = [1];
plot!(t,filter(b,a,x), label ="filter(1,[1/"*sw*",...],x)")
# Simple Moving Average
plot!(t, sma(x,w,true), label = "sma(x,"*sw*",true)")
```

## References
* [Cleveland et al. 1990] Cleveland, R. B.; Cleveland, W. S.; McRae, J. E.; and Terpenning, I. 1990. STL: A seasonal-trend decomposition procedure based on loess. Journal of Official Statistics 6(1):3–73.
* Henderson, R. (1916). Note on graduation by adjusted average. Transactions of the Actuarial Society of America, 17:43-48. [Australian Bureau of Statistics: What Are Henderson Moving Averages?](https://www.abs.gov.au/websitedbs/d3310114.nsf/4a256353001af3ed4b2562bb00121564/5fc845406def2c3dca256ce100188f8e!OpenDocument#:~:text=WHAT%20ARE%20HENDERSON%20MOVING%20AVERAGES%3F)
* Octave Forge: [filter function](https://octave.sourceforge.io/octave/function/filter.html)
[](https://github.com/viraltux/Smoothers.jl/actions)
[](https://codecov.io/gh/viraltux/Smoothers.jl)