diff --git a/Project.toml b/Project.toml index 25a9d35..d1790fb 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Smoothers" uuid = "012d725f-b4dd-4916-8440-03955fc52575" authors = ["Fran Urbano and contributors"] -version = "0.1.2" +version = "0.1.3" [deps] Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94" diff --git a/README.md b/README.md index 4876e0f..2333cd2 100644 --- a/README.md +++ b/README.md @@ -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**) diff --git a/src/hma.jl b/src/hma.jl index 62609f5..e82c742 100644 --- a/src/hma.jl +++ b/src/hma.jl @@ -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 diff --git a/src/loess.jl b/src/loess.jl index e81cb5d..a5d4050 100644 --- a/src/loess.jl +++ b/src/loess.jl @@ -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. @@ -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. diff --git a/src/sma.jl b/src/sma.jl index cae1260..063c685 100644 --- a/src/sma.jl +++ b/src/sma.jl @@ -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