daru

https://github.com/sciruby/daru

Ruby

Data Analysis in RUby

Daru::Maths::Statistics::Vector#diff

Performs the difference of the series.
Note: The first difference of series is X(t) - X(t-1)
But, second difference of series is NOT X(t) - X(t-2)
It is the first difference of the first difference
=> (X(t) - X(t-1)) - (X(t-1) - X(t-2))

== Arguments

* *max_lags*: integer, (default: 1), number of differences reqd.

Source | Google | Stack overflow

Edit

git clone [email protected]:sciruby/daru.git

cd daru

open lib/daru/maths/statistics/vector.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Daru--Maths--Statistics--Vector-diff-for-pr


# Commit to git

git add lib/daru/maths/statistics/vector.rbgit commit -m "better docs for Daru::Maths::Statistics::Vector#diff"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Daru--Maths--Statistics--Vector-diff-for-pr

hub pull-request


# Celebrate!