PDF of Rayleigh distribution

@param x Value
@param sigma Scale
@return PDF at position x.
432034
public static double pdf(double x, double sigma) {
    if(!(x > 0.) || x == Double.POSITIVE_INFINITY) {
      return x == x ? 0. : Double.NaN;
    }
    final double xs = x / sigma;
    final double v = FastMath.exp(-.5 * xs * xs);
    return v > 0. ? xs / sigma * v : 0.;
  }
780473
def pdf_new(self, x, mu, sigma, skw):
        
        if skw > 1 or skw < -1:
            print("skewness %s out of range" % skw)
            skw = 1.
        e, w, a = self.map_mu_sigma_skw(mu, sigma, skw)
        pdf = self.pdf(x, e, w, a)
        return pdf
1074533
public static double cdf(double val, double mu, double sigma, double xi) {
    val = (val - mu) / sigma;
    // Check support:
    if(val < 0) {
      return 0.;
    }
    if(xi < 0 && val > -1. / xi) {
      return 1.;
    }
    return 1 - FastMath.pow(1 + xi * val, -1. / xi);
  }
357440
@VisibleForTesting
    protected static String createLabelText(
            final DistanceUnit scaleUnit, final double value, final DistanceUnit intervalUnit) {
        double scaledValue = scaleUnit.convertTo(value, intervalUnit);

        // assume that there is no interval smaller then 0.0001
        scaledValue = Math.round(scaledValue * 10000) / 10000;
        String decimals = Double.toString(scaledValue).split("\\.")[1];

        if (Double.valueOf(decimals) == 0) {
            return Long.toString(Math.round(scaledValue));
        } else {
            return Double.toString(scaledValue);
        }
    }
513569
public static double cdf(double x, double sigma) {
    if(x <= 0.) {
      return 0.;
    }
    final double xs = x / sigma;
    return 1. - FastMath.exp(-.5 * xs * xs);
  }
892568
public static double pdf(double val, double loc, double scale, double shape) {
    if(!(val < Double.POSITIVE_INFINITY && val > Double.NEGATIVE_INFINITY)) {
      return val == val ? 0. : Double.NaN;
    }
    val = (val - loc) / scale;
    double e = FastMath.exp(-val);
    double f = 1. + e;
    return e < Double.POSITIVE_INFINITY ? shape * e / (scale * FastMath.pow(f, shape + 1.)) : 0.;
  }
836282
@Pure
	public double fx2docX(double x) {
		return this.centeringTransform.toGlobalX((x - this.canvasWidth.get() / 2.) / this.scale.get());
	}
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;
  }
1002866
function partial( sigma ) {

	/**
	* FUNCTION: quantile( p )
	*	Evaluates the quantile function for a Rayleigh distribution.
	*
	* @private
	* @param {Number} p - input value
	* @returns {Number} evaluated quantile function
	*/
	return function quantile( p ) {
		if ( p !== p || p < 0 || p > 1 ) {
			return NaN;
		}
		return sigma * sqrt( -ln( pow( 1 - p, 2 ) ) );
	};
}
477909
public static double pdf(double x, double k, double theta) {
    if(x < 0) {
      return 0.;
    }
    if(x == 0) {
      return (k == 1.) ? theta : 0;
    }
    if(k == 1.) {
      return FastMath.exp(-x * theta) * theta;
    }
    final double xt = x * theta;
    return (xt == Double.POSITIVE_INFINITY) ? 0. : //
        FastMath.exp((k - 1.0) * FastMath.log(xt) - xt - logGamma(k)) * theta;
  }
607121
def gauss_pdf(x, mu, sigma):
    """"""
    return 1 / np.sqrt(2 * np.pi) / sigma * np.exp(-(x - mu) ** 2 / 2. / sigma ** 2)
1367439
private double getDensityOutlierScore(ClusKernel x, ClusKernel entry) {
		double[] sigmaSquared = entry.getVarianceVector();
		// f(x) = factor * e^( -0.5 (x- mu ) * Sigma ^-1 * (x- mu ) )
		double resultDensity = 0;

		// exponent = -0.5 (x- mu ) * Sigma ^-1 * (x- mu ) )
		//                = -0.5 ( sum_d ((x_i - mu_i)^2 / var_i) )
		double exponent = 0.0;
		double[] mu = entry.getCenter();

		// factor = 1 / sqrt ( (2*PI)^d * \prod_d(variance) )
		//        = 1 / sqrt ((2*PI)^d) * sqrt (\prod_d(variance))
		//        = 1 / (2*PI)^(d/2)   * \prod_d( sqrt (variance))
		double factor = Math.pow( (2.0 * Math.PI) , ((sigmaSquared.length/2.0)) );
		for (int i = 0; i < sigmaSquared.length; i++) {
			factor *= Math.sqrt(sigmaSquared[i]);
			exponent += ((x.LS[i] - mu[i])*(x.LS[i] - mu[i])) / sigmaSquared[i];
		}

		// factor = 1 / sqrt ( (2*PI)^d * \prod_d(variance) )
		factor = 1 / factor;
		exponent *= -0.5;
		//System.out.println(factor);
		resultDensity = factor * Math.exp(exponent);
		//System.out.println(resultDensity);

		// TODO: dangerous, since the density is not necessarily between 0 and 1
		return 1-resultDensity;
	}
435746
public static double quantile(double x, double mu, double sigma) {
    return FastMath.exp(mu + sigma * NormalDistribution.standardNormalQuantile(x));
  }
1223513
def pdf(self, x):
        
        if self.transform is not None:
            x = self.transform(x)               
        return (x**(-self.alpha-1))*np.exp(-(self.beta/float(x)))
817627
private double pdf(double x, int j)
    {
        /*
         *              n
         *            =====  /x - x \
         *         1  \      |     i|
         * f(x) = ---  >    K|------|
         *        n h /      \   h  /
         *            =====
         *            i = 1
         * 
         */
        
        
        //Only values within a certain range will have an effect on the result, so we will skip to that range!
        int from = Arrays.binarySearch(X, x-h*k.cutOff());
        int to = Arrays.binarySearch(X, x+h*k.cutOff());
        //Mostly likely the exact value of x is not in the list, so it returns the inseration points
        from = from < 0 ? -from-1 : from;
        to = to < 0 ? -to-1 : to;
        
        //Univariate opt, if uniform weights, the sum is just the number of elements divide by half
        if(weights.length == 0 && k instanceof UniformKF)
            return (to-from)*0.5/ (sumOFWeights*h);
        
        double sum = 0;
        for(int i = Math.max(0, from); i < Math.min(X.length, to+1); i++)
            if(i != j)
                sum += k.k( (x-X[i])/h )*getWeight(i);
        
        return sum / (sumOFWeights * h);
    }
564788
public static double logpdf(double x, double mu, double sigma, double xi) {
    x = (x - mu) / sigma;
    // Check support:
    if(x < 0 || (xi < 0 && x > -1. / xi)) {
      return Double.NEGATIVE_INFINITY;
    }
    if(xi == 0) {
      return Double.POSITIVE_INFINITY;
    }
    return ((xi == -1) ? 0. : FastMath.log(1 + xi * x) * (-1 / xi - 1)) - FastMath.log(sigma);
  }
99795
public ScaleLevel getLevelFor(Font font, FontRenderContext frc, DoubleTransform transformer, boolean horizontal, double xy)
    {
        return getLevelFor(font, frc, transformer, horizontal, xy, null);
    }