daru
https://github.com/sciruby/daru
Ruby
Data Analysis in RUby
Daru::Maths::Statistics::Vector#ema
Exponential Moving Average. Calculates an exponential moving average of the series using a specified parameter. If wilder is false (the default) then the EMA uses a smoothing value of 2 / (n + 1), if it is true then it uses the Welles Wilder smoother of 1 / n. Warning for EMA usage: EMAs are unstable for small series, as they use a lot more than n observations to calculate. The series is stable if the size of the series is >= 3.45 * (n + 1)
Edit
git clone [email protected]:sciruby/daru.git
cd daru
open lib/daru/maths/statistics/vector.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Daru--Maths--Statistics--Vector-ema-for-pr
# Commit to gitgit add lib/daru/maths/statistics/vector.rbgit commit -m "better docs for Daru::Maths::Statistics::Vector#ema"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Daru--Maths--Statistics--Vector-ema-for-pr
hub pull-request
# Celebrate!