Gaussian distribution

The normal distribution or Gaussian distribution is a continuous probability distribution that often gives a good description of data that cluster around the mean.

    /**
     *   The aim of this static method is to implememnt the function of Gaussian distribution
     *   N(μ,σ2)
     * @param x   variable
     * @param mean   mathematic expectation
     * @param stdDev Variance
     * @return
     */
    public static double normalDens(double x, double mean, double stdDev) {
         double diff = x - mean;
         return (1 / ( Math.sqrt(2 * Math.PI) * stdDev))
                 * Math.exp(-(diff * diff / (2 * stdDev * stdDev)));
     }

Tags:

No comments yet.

Leave a Reply