Comments (2)
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.
Thank you very much!
from timeseries-analysis.
Related Issues (16)
- Pure Javascript implementation? HOT 2
- coeffs NaN HOT 5
- Getting forecasted point HOT 2
- Forecasting data form existing data set. HOT 4
- google chart url broken HOT 1
- From mongoose, get date from nested element
- anyupdates HOT 4
- coeffs [null,null,null,null,null] HOT 3
- Forecasting Data HOT 3
- Feature request: MA for time period even if data is missing HOT 3
- Returning NAN after length of indicator.
- Reference for smoother() HOT 2
- Request to make forecasting new values feature work
- Timeseries Analysis Version 2
- [feature] configure graph type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timeseries-analysis.