當前位置: 首頁>>代碼示例>>Java>>正文


Java NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY屬性代碼示例

本文整理匯總了Java中org.apache.commons.math3.distribution.NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY屬性的典型用法代碼示例。如果您正苦於以下問題:Java NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY屬性的具體用法?Java NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY怎麽用?Java NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.commons.math3.distribution.NormalDistribution的用法示例。


在下文中一共展示了NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY屬性的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: RandomCirclePointGenerator

/**
 * @param x Abscissa of the circle center.
 * @param y Ordinate of the circle center.
 * @param radius Radius of the circle.
 * @param xSigma Error on the x-coordinate of the circumference points.
 * @param ySigma Error on the y-coordinate of the circumference points.
 * @param seed RNG seed.
 */
public RandomCirclePointGenerator(double x,
                                  double y,
                                  double radius,
                                  double xSigma,
                                  double ySigma,
                                  long seed) {
    final RandomGenerator rng = new Well44497b(seed);
    this.radius = radius;
    cX = new NormalDistribution(rng, x, xSigma,
                                NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    cY = new NormalDistribution(rng, y, ySigma,
                                NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    tP = new UniformRealDistribution(rng, 0, MathUtils.TWO_PI,
                                     UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
}
 
開發者ID:Quanticol,項目名稱:CARMA,代碼行數:23,代碼來源:RandomCirclePointGenerator.java

示例2: getKernel

/**
 * The within-bin smoothing kernel. Returns a Gaussian distribution
 * parameterized by {@code bStats}, unless the bin contains only one
 * observation, in which case a constant distribution is returned.
 *
 * @param bStats summary statistics for the bin
 * @return within-bin kernel parameterized by bStats
 */
protected RealDistribution getKernel(SummaryStatistics bStats) {
    if (bStats.getN() == 1 || bStats.getVariance() == 0) {
        return new ConstantRealDistribution(bStats.getMean());
    } else {
        return new NormalDistribution(randomData.getRandomGenerator(),
            bStats.getMean(), bStats.getStandardDeviation(),
            NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    }
}
 
開發者ID:biocompibens,項目名稱:SME,代碼行數:17,代碼來源:EmpiricalDistribution.java

示例3: getKernel

/**
 * The within-bin smoothing kernel. Returns a Gaussian distribution
 * parameterized by {@code bStats}, unless the bin contains only one
 * observation, in which case a constant distribution is returned.
 *
 * @param bStats summary statistics for the bin
 * @return within-bin kernel parameterized by bStats
 */
protected RealDistribution getKernel(SummaryStatistics bStats) {
    if (bStats.getN() == 1) {
        return new ConstantRealDistribution(bStats.getMean());
    } else {
        return new NormalDistribution(randomData.getRandomGenerator(),
            bStats.getMean(), bStats.getStandardDeviation(),
            NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    }
}
 
開發者ID:Quanticol,項目名稱:CARMA,代碼行數:17,代碼來源:EmpiricalDistribution.java

示例4: nextNormal

/**
 * Generates a random value for the normal distribution with the mean equal to {@code mu} and standard deviation
 * equal to {@code sigma}.
 *
 * @param mu    the mean of the distribution
 * @param sigma the standard deviation of the distribution
 * @return a random value for the given normal distribution
 */
public static double nextNormal(final RandomGenerator rng, final double mu, final double sigma) {
    final NormalDistribution normalDistribution =
            new NormalDistribution(rng, mu, sigma, NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    while (true) {
        final double sample = normalDistribution.sample();
        if (!Doubles.isFinite(sample)) {
            logger.warn("Discarding non finite sample from normal distribution (mu={}, sigma={}): {}",
                    mu, sigma, sample);
            continue;
        }
        return sample;
    }
}
 
開發者ID:asoem,項目名稱:greyfish,代碼行數:21,代碼來源:RandomGenerators.java

示例5: normal

/**
 * A uniform sample ranging from 0 to sigma.
 *
 * @param rng   the rng to use
 * @param mean, the matrix mean from which to generate values from
 * @param sigma the standard deviation to use to generate the gaussian noise
 * @return a uniform sample of the given shape and size
 * <p/>
 * with numbers between 0 and 1
 */
public static INDArray  normal(RandomGenerator rng, INDArray mean, INDArray sigma) {
    INDArray iter = mean.reshape(new int[]{1,mean.length()}).dup();
    INDArray sigmaLinear = sigma.ravel();
    for(int i = 0; i < iter.length(); i++) {
        RealDistribution reals = new NormalDistribution(rng, mean.getFloat(i), FastMath.sqrt((double) sigmaLinear.getFloat(i)),NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
        iter.putScalar(i,reals.sample());

    }
    return iter.reshape(mean.shape());
}
 
開發者ID:wlin12,項目名稱:JNN,代碼行數:20,代碼來源:Sampling.java

示例6: genGaussianNoise

public INDArray genGaussianNoise(int id){
	if(!currentNoise.containsKey(id)){
		INDArray zeroMean = Nd4j.zeros(inputSize, outputSize);
		currentNoise.put(id,Sampling.normal(RandomUtils.getRandomGenerator(id), zeroMean, noiseVar));
	}
	else{
		RealDistribution reals = new NormalDistribution(RandomUtils.getRandomGenerator(id),0, noiseVarSqrt,NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
		INDArrayUtils.shiftLeft(currentNoise.get(id), inputSize, outputSize,  RandomUtils.getRandomGenerator(id).nextInt(inputSize*outputSize), reals.sample());
	}

	//		currentNoise = Sampling.normal(RandomUtils.getRandomGenerator(id), zeroMean, noiseVar);

	return currentNoise.get(id); 
}
 
開發者ID:wlin12,項目名稱:JNN,代碼行數:14,代碼來源:DenseFeatureMatrix.java

示例7: genGaussianNoise

public INDArray genGaussianNoise(int id){
	if(!currentNoise.containsKey(id)){
		INDArray zeroMean = Nd4j.zeros(outputSize);
		currentNoise.put(id,Sampling.normal(RandomUtils.getRandomGenerator(id), zeroMean, noiseVar));
	}
	else{
		RealDistribution reals = new NormalDistribution(RandomUtils.getRandomGenerator(id),0, noiseVarSqrt,NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
		INDArrayUtils.shiftLeft(currentNoise.get(id), outputSize, RandomUtils.getRandomGenerator(id).nextInt(outputSize), reals.sample());
	}
	return currentNoise.get(id); 
}
 
開發者ID:wlin12,項目名稱:JNN,代碼行數:11,代碼來源:DenseFeatureVector.java

示例8: getKernel

/**
 * The within-bin smoothing kernel.
 *
 * @param bStats summary statistics for the bin
 * @return within-bin kernel parameterized by bStats
 */
protected RealDistribution getKernel(SummaryStatistics bStats) {
    // Default to Gaussian
    return new NormalDistribution(randomData.getRandomGenerator(),
            bStats.getMean(), bStats.getStandardDeviation(),
            NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:12,代碼來源:EmpiricalDistribution.java

示例9: get

@Override
public Distribution get()
{
    return new DistributionBoundApache(new NormalDistribution(new JDKRandomGenerator(), mean, stdev, NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY), min, max);
}
 
開發者ID:vcostet,項目名稱:cassandra-kmean,代碼行數:5,代碼來源:OptionDistribution.java

示例10: rNorm

/**
 * Return a random value from a normal distribution with the given mean and standard deviation
 * 
 * @param mean
 *          a double mean value
 * @param sd
 *          a double standard deviation
 * @return a double sample
 */
public static double rNorm(double mean, double sd) {
  RealDistribution dist = new NormalDistribution(RANDOM.getRandomGenerator(),
                                                 mean,
                                                 sd,
                                                 NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
  return dist.sample();
}
 
開發者ID:saradelrio,項目名稱:Chi-FRBCS-BigDataCS,代碼行數:16,代碼來源:UncommonDistributions.java

示例11: RandomStraightLinePointGenerator

/**
 * The generator will create a cloud of points whose x-coordinates
 * will be randomly sampled between {@code xLo} and {@code xHi}, and
 * the corresponding y-coordinates will be computed as
 * <pre><code>
 *  y = a x + b + N(0, error)
 * </code></pre>
 * where {@code N(mean, sigma)} is a Gaussian distribution with the
 * given mean and standard deviation.
 *
 * @param a Slope.
 * @param b Intercept.
 * @param sigma Standard deviation on the y-coordinate of the point.
 * @param lo Lowest value of the x-coordinate.
 * @param hi Highest value of the x-coordinate.
 * @param seed RNG seed.
 */
public RandomStraightLinePointGenerator(double a,
                                        double b,
                                        double sigma,
                                        double lo,
                                        double hi,
                                        long seed) {
    final RandomGenerator rng = new Well44497b(seed);
    slope = a;
    intercept = b;
    error = new NormalDistribution(rng, 0, sigma,
                                   NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
    x = new UniformRealDistribution(rng, lo, hi,
                                    UniformRealDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY);
}
 
開發者ID:Quanticol,項目名稱:CARMA,代碼行數:31,代碼來源:RandomStraightLinePointGenerator.java


注:本文中的org.apache.commons.math3.distribution.NormalDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。