Probability density function of the ExGaussian distribution.

@param x The value.
@param mu The mean.
@param sigma The standard deviation.
@param lambda Rate parameter.
@return PDF of the given exgauss distribution at x.
167920
public static double pdf(double x, double mu, double sigma, double lambda) {
    final double dx = x - mu;
    final double lss = lambda * sigma * sigma;
    final double erfc = NormalDistribution.erfc((lss - dx) / (sigma * MathUtil.SQRT2));
    return erfc > 0. ? .5 * lambda * FastMath.exp(lambda * (lss * .5 - dx)) * erfc : (x == x) ? 0. : Double.NaN;
  }
156394
public static double logpdf(double x, double mu, double beta) {
    if(x == Double.NEGATIVE_INFINITY) {
      return Double.NEGATIVE_INFINITY;
    }
    final double z = (x - mu) / beta;
    return -z - FastMath.exp(-z) - FastMath.log(beta);
  }
1318380
def pdf_internal(x, df, loc=0.0, scale=1.0, gamma = 1.0):
        
        result = np.zeros(x.shape[0])
        result[x<0] = 2.0/(gamma + 1.0/gamma)*stats.t.pdf(x=gamma*x[(x-loc) < 0], loc=loc[(x-loc) < 0]*gamma,df=df, scale=scale)
        result[x>=0] = 2.0/(gamma + 1.0/gamma)*stats.t.pdf(x=x[(x-loc) >= 0]/gamma, loc=loc[(x-loc) >= 0]/gamma,df=df, scale=scale)
        return result
551194
def cumulative_distribution(self, X):
        
        self.check_fit()

        # Wrapper for pdf to accept vector as args
        def func(*args):
            return self.probability_density(list(args))

        # Lower bound for integral, to split significant part from tail
        lower_bound = self.get_lower_bound()

        ranges = [[lower_bound, val] for val in X]
        return integrate.nquad(func, ranges)[0]
709417
def _optm(x, alpha, mu, sigma):
    '''
    '''
    return ss.skewnorm.pdf(x, alpha, mu, sigma)
941870
public static double logPdf(double x, double mu, double sigma)
    {
        return -0.5*log(2*PI) - log(sigma) + -pow(x-mu,2)/(2*sigma*sigma);
    }
562476
public static void standardize(double[] x) {
        double mu = mean(x);
        double sigma = sd(x);

        if (isZero(sigma)) {
            logger.warn("array has variance of 0.");
            return;
        }

        for (int i = 0; i < x.length; i++) {
            x[i] = (x[i] - mu) / sigma;
        }
    }
1198059
def MakeGaussianPmf(mu, sigma, num_sigmas, n=201):
    
    pmf = Pmf()
    low = mu - num_sigmas * sigma
    high = mu + num_sigmas * sigma

    for x in numpy.linspace(low, high, n):
        p = EvalGaussianPdf(x, mu, sigma)
        pmf.Set(x, p)
    pmf.Normalize()
    return pmf
1211059
def plot_dist_normal(s, mu, sigma):
    
    import matplotlib.pyplot as plt
    count, bins, ignored = plt.hist(s, 30, normed=True)
    plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) \
            * np.exp( - (bins - mu)**2 / (2 * sigma**2) ), \
            linewidth = 2, color = 'r')
    plt.show()
687722
public static double logNormalDistribution(double sigma, double x) {
        return Math.log(1.0 / (sqrt(2.0 * PI) * sigma)) + (-0.5 * pow(x / sigma, 2));
    }
435746
public static double quantile(double x, double mu, double sigma) {
    return FastMath.exp(mu + sigma * NormalDistribution.standardNormalQuantile(x));
  }
1139542
public static double pdf(double x, double mu, double sigma, double skew) {
    if(x != x) {
      return Double.NaN;
    }
    x = (x - mu) / sigma; // Scale
    if(skew == 0.) {
      return MathUtil.ONE_BY_SQRTTWOPI / sigma * FastMath.exp(-.5 * x * x);
    }
    final double y = -FastMath.log1p(-skew * x) / skew;
    if(y != y || y == Double.POSITIVE_INFINITY || y == Double.NEGATIVE_INFINITY) { // NaN
      return 0.;
    }
    return MathUtil.ONE_BY_SQRTTWOPI / sigma * FastMath.exp(-.5 * y * y) / (1 - skew * x);
  }
167168
def gev_expval(xi, mu=0, sigma=1):
    
    return mu - (sigma / xi) + (sigma / xi) * flib.gamfun(1 - xi)
1021506
def Gaussian(x, mu, sig):
    
    return sympy.exp(-(x - mu)**2/(2*sig**2))/sympy.sqrt(2*sympy.pi*sig**2)
1150709
public static double pdf(double x, double k, double theta, double shift) {
    if(x == Double.POSITIVE_INFINITY || x == Double.NEGATIVE_INFINITY) {
      return 0.;
    }
    if(x != x) {
      return Double.NaN;
    }
    x = (x - shift) * theta;
    final double ex = FastMath.exp(x);
    return ex < Double.POSITIVE_INFINITY ? FastMath.exp(k * x - ex - GammaDistribution.logGamma(k)) * theta : 0.;
  }
393586
def gauss(x, sigma):
    
    return (np.exp(-np.power(x, 2) / (2 * np.power(sigma, 2))) /
            (sigma * np.sqrt(2 * np.pi)))
874309
public static double logpdf(double x, double sigma) {
    if(!(x > 0.) || x == Double.POSITIVE_INFINITY) {
      return x == x ? Double.NEGATIVE_INFINITY : Double.NaN;
    }
    final double xs = x / sigma, xs2 = xs * xs;
    return xs2 < Double.POSITIVE_INFINITY ? FastMath.log(xs / sigma) - .5 * xs2 : Double.NEGATIVE_INFINITY;
  }