Java Gauss gaussian(double mu, double sigma, double x)

Here you can find the source of gaussian(double mu, double sigma, double x)

Description

Gaussian probabilty density function

License

Open Source License

Parameter

Parameter Description
mu a parameter
sigma a parameter
x a parameter

Return

probability

Declaration

public final static double gaussian(double mu, double sigma, double x) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2013 Serdar Ormanl?./*from   w  w w.j  a v a2 s  .  c  o  m*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Serdar Ormanl? - initial API and implementation
 ******************************************************************************/

public class Main {
    /**
     * Gaussian probabilty density function
     * 
     * @param mu
     * @param sigma
     * @param x
     * @return probability
     */
    public final static double gaussian(double mu, double sigma, double x) {
        return (1 / (sigma * Math.sqrt(2.0 * Math.PI))) * Math.exp(-0.5 * Math.pow(((x - mu) / sigma), 2));
    }
}

Related

  1. gauss(double[] A, int m, int n)
  2. gauss(final double mean, final double sigma, final double x)
  3. gauss(int N, long seed)
  4. GaussElimination(double a[][])
  5. gaussian(double a[][], int index[])
  6. gaussian(double mu, double sigma, double x)
  7. gaussian(double t)
  8. gaussian(double x, double sigma)
  9. gaussian(double[] d, double sigma, double mean)