Skip to content

Commit

Permalink
v0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
viraltux committed Sep 5, 2021
1 parent a0cf19e commit 5caf8da
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Smoothers"
uuid = "012d725f-b4dd-4916-8440-03955fc52575"
authors = ["Fran Urbano <viraltux@gmail.com> and contributors"]
version = "0.1.2"
version = "0.1.3"

[deps]
Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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 (**filter**)
* 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**)
Expand Down
2 changes: 1 addition & 1 deletion src/hma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Package: Forecast
hma(x, n)
Applies the Henderson moving average filter to dataset `s` with `n`-term.
Applies the Henderson moving average filter to dataset `x` with `n`-term.
"Henderson moving averages are filters which were derived by Robert Henderson in 1916
for use in actuarial applications. They are trend filters, commonly used in time series
Expand Down
8 changes: 7 additions & 1 deletion src/loess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Package: Forecast
rho = fill(1.0,length(yv)),
exact = [], extra = [])
loess(yv;
d = 0,
q = 3*sum((!ismissing).(yv))÷4,
rho = fill(1.0,length(yv)),
exact = [], extra = [])
Return a funcion to smooth a vector of observations using locally weighted regressions.
Although loess can be used to smooth observations for any given number of independent variables, this implementation is univariate. The speed of loess can be greatly increased by using fast aproximations for the linear fitting calculations, however this implementation calculates allows as well for exact results.
Expand All @@ -18,7 +24,7 @@ Robert B. Cleveland, William S. Cleveland, Jean E. McRae, and Irma Terpenning.
Journal of Official Statistics Vol. 6. No. 1, 1990, pp. 3-73 (c) Statistics Sweden.
# Arguments
- `xv`: Observations' support.
- `xv`: Observations' support, if not provided 1:length(yv) is used instead.
- `yv`: Observation values.
- `d`: Degree of the linear fit, it accepts values 0, 1 or 2, if 0 an estimation of `d` is calculated.
- `q`: As q increases loess becomes smoother, when q tends to infinity loess tends to an ordinary least square poynomial fit of degree `d`. It defaults to the rounding of 3/4 of xv's non-missing values length.
Expand Down
3 changes: 1 addition & 2 deletions src/sma.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""
Package: Smoothers
sma(x, n)
sma(x, n, center)
sma(x, n, center=false)
Smooth a vector of data using a simple moving average
Expand Down

0 comments on commit 5caf8da

Please sign in to comment.