Pages: [1]   Go Down
Author Topic: [Published on GitHub] Gaussian Class and Moving Average  (Read 713 times)
0 Members and 1 Guest are viewing this topic.
Brasil
Offline Offline
Full Member
***
Karma: 4
Posts: 125
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi folks,

After a lot of work, I could manage to make a Gaussian "simple" enough to use and implement almos everything.

In this Library summing Gaussians is really easy, like this:

Code:
Gaussian g1 = Gaussian(10, 30.4);

Gaussian result = g1 + Gaussian(30, 40);

There is also a Moving Average class, called "GaussianAverage". It works great with Gaussians and also simple values.

Code:
GaussianAverage myAverage(10); // 10 samples to keep track of

myAverage += Gaussian(32, 2.45);
myAverage += 10; // Automaticaly adds a Gaussian with Maximum variance

Gaussian average = myAverage.process();

For more information and a very detailed documentation, go to https://github.com/ivanseidel/Gaussian

Fell free to commit new changes and use it.

Ivan
« Last Edit: July 21, 2013, 07:11:40 am by ivanseidel » Logged


Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13724
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote

think the link is not right smiley-wink
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Brasil
Offline Offline
Full Member
***
Karma: 4
Posts: 125
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote

think the link is not right smiley-wink


Now it's Okay =]
Logged


Brasil
Offline Offline
Full Member
***
Karma: 4
Posts: 125
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Two more methods implemented:

  • double Gaussian::plot(double x) - Returns the probability of 'x'.
  • double Gaussian::random() - Returns a normaly distributed value with the mean and variance of the Gaussian.

Useful for ploting and generating random Gaussian distributed values.
Logged


Pages: [1]   Go Up
Jump to: