Coder Social home page Coder Social logo

Method author? about timeseries-analysis HOT 2 CLOSED

DDAGitHub avatar DDAGitHub commented on July 29, 2024
Method author?

from timeseries-analysis.

Comments (2)

26medias avatar 26medias commented on July 29, 2024

Hi,

This type of algorithm is apparently called a multi-pass moving average by convolution.

I built the algorithm myself.
It's a pretty simple recursive algo.
Each point in the output chart is the recursive average of its previous and next point:

Loop X times:
For each point in the chart, except for the first and last one:
point[n] = (point[n-1]+point[n+1])/2;

X is the "period" parameter of the algorithm.
For example, if you were executing xxx.smoother ({period:5}) then the chart would be smoothed 5 times in a row.

The 1st and last points are always equal to their corresponding value in the input data.

That algorithm provides the best possible smoothing I could ever obtain, but because of the way that algorithm works, any new slight change in an point of the chart will affect the entire output.
That also means that it's a smoothing method you can't use on dynamic data like the stock market for example, because the smoothing would continually change, so you wouldn't be able to use its output in algorithmic trading for example.

But on static data, it is performing much better than a regular moving average or even a multi-pole smoothing filter, as it has no lag and a very fast response time.

Another description of a similar algorithm:
http://www.analog.com/media/en/technical-documentation/dsp-book/dsp_book_Ch15.pdf

In my algorithm, I ignore point[n] in the calculation and only include its neighbors, contrary to a regular moving average by convolution where they take the current point in consideration in the calculation.
Mine seems to have a faster response time but both are pretty much equivalent in the output.

from timeseries-analysis.

DDAGitHub avatar DDAGitHub commented on July 29, 2024

Thank you very much!

from timeseries-analysis.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.