org.apache.mahout.math.jet.random.Normal.setState()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.apache.mahout.math.jet.random.Normal.setState()方法的一些代码示例,展示了Normal.setState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Normal.setState()方法的具体详情如下:
包路径:org.apache.mahout.math.jet.random.Normal
类名称:Normal
方法名:setState

Normal.setState介绍

[英]Sets the mean and variance.
[中]设置均值和方差。

代码示例

代码示例来源:origin: apache/mahout

/**
 * @param mean               The mean of the resulting distribution.
 * @param standardDeviation  The standard deviation of the distribution.
 * @param randomGenerator    The random number generator to use.  This can be null if you don't
 * need to generate any numbers.
 */
public Normal(double mean, double standardDeviation, Random randomGenerator) {
 setRandomGenerator(randomGenerator);
 setState(mean, standardDeviation);
}

代码示例来源:origin: apache/mahout

@Test
public void consistency() {
 Random gen = RandomUtils.getRandom();
 double offset = 0;
 double scale = 1;
 Normal dist = new Normal(offset, scale, RandomUtils.getRandom());
 for (int k = 0; k < 20; k++) {
  dist.setState(offset, scale);
  DistributionChecks.checkDistribution(dist, breaks, offset, scale, 10000);
  offset = gen.nextGaussian();
  scale = Math.exp(3 * gen.nextGaussian());
 }
}

代码示例来源:origin: apache/mahout

@Test
public void testSetState() throws Exception {
 Normal dist = new Normal(0, 1, RandomUtils.getRandom());
 dist.setState(1.3, 5.9);
 DistributionChecks.checkDistribution(dist, breaks, 1.3, 5.9, 10000);
}

代码示例来源:origin: org.apache.mahout/mahout-math

/**
 * @param mean               The mean of the resulting distribution.
 * @param standardDeviation  The standard deviation of the distribution.
 * @param randomGenerator    The random number generator to use.  This can be null if you don't
 * need to generate any numbers.
 */
public Normal(double mean, double standardDeviation, Random randomGenerator) {
 setRandomGenerator(randomGenerator);
 setState(mean, standardDeviation);
}

代码示例来源:origin: cloudera/mahout

/**
 * @param mean               The mean of the resulting distribution.
 * @param standardDeviation  The standard deviation of the distribution.
 * @param randomGenerator    The random number generator to use.  This can be null if you don't
 * need to generate any numbers.
 */
public Normal(double mean, double standardDeviation, Random randomGenerator) {
 setRandomGenerator(randomGenerator);
 setState(mean, standardDeviation);
}

代码示例来源:origin: cloudera/mahout

@Test
public void consistency() throws Exception {
 Random gen = RandomUtils.getRandom();
 double offset = 0;
 double scale = 1;
 Normal dist = new Normal(offset, scale, RandomUtils.getRandom());
 for (int k = 0; k < 20; k++) {
  dist.setState(offset, scale);
  DistributionChecks.checkDistribution(dist, breaks, offset, scale, 10000);
  offset = gen.nextGaussian();
  scale = Math.exp(3 * gen.nextGaussian());
 }
}

代码示例来源:origin: cloudera/mahout

@Test
public void testSetState() throws Exception {
 Normal dist = new Normal(0, 1, RandomUtils.getRandom());
 dist.setState(1.3, 5.9);
 DistributionChecks.checkDistribution(dist, breaks, 1.3, 5.9, 10000);
}

相关文章