package yi.stat;

/**
 * Utilities of Gaussian Distribution
 */

public class GaussianUtil {
  /**
   * x~N(0, sigma), return p(x=x1)
   * @param sigma
   * @param x
   * @return
   */
  public static double getProbability(double sigma, double x) {
    return Math.exp( -0.5 * x * x / (sigma * sigma)) /
        (sigma * Math.sqrt(2 * Math.PI));
  }
}