Here you can find the source of gaussian(double mu, double sigma, double x)
Parameter | Description |
---|---|
mu | a parameter |
sigma | a parameter |
x | a parameter |
public final static double gaussian(double mu, double sigma, double x)
//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)); } }