[Published on GitHub] Gaussian Class and Moving Average

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:

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.

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

go to https://github.com/ivanseidel/LinkedList

think the link is not right ;)

robtillaart:

go to https://github.com/ivanseidel/LinkedList

think the link is not right ;)

Now it's Okay =]

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.