当前位置: 首页>>代码示例>>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;未经允许,请勿转载。