de.lmu.ifi.dbs.elki.math.statistics.distribution.Distribution.nextRandom()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(118)

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

Distribution.nextRandom介绍

[英]Generate a new random value
[中]生成一个新的随机值

代码示例

代码示例来源:origin: elki-project/elki

@Override
 public boolean visit(double val, int row, int col, boolean selrow, boolean selcol) {
  assert (selrow && selcol);
  mat[row][col] = replacement.nextRandom();
  return false;
 }
});

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-clustering

@Override
 public boolean visit(double val, int row, int col, boolean selrow, boolean selcol) {
  assert (selrow && selcol);
  mat[row][col] = replacement.nextRandom();
  return false;
 }
});

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki

@Override
 public boolean visit(double val, int row, int col, boolean selrow, boolean selcol) {
  assert (selrow && selcol);
  mat[row][col] = replacement.nextRandom();
  return false;
 }
});

代码示例来源:origin: elki-project/elki

/**
 * Generate the given number of additional points.
 *
 * @see de.lmu.ifi.dbs.elki.data.synthetic.bymodel.GeneratorInterface#generate(int)
 */
@Override
public List<double[]> generate(int count) {
 ArrayList<double[]> result = new ArrayList<>(count);
 while(result.size() < count) {
  double[] d = new double[dim];
  for(int i = 0; i < dim; i++) {
   d[i] = axes.get(i).nextRandom();
  }
  if(trans != null) {
   d = trans.apply(d);
  }
  if(testClipping(d)) {
   if(--retries < 0) {
    throw new AbortException("Maximum retry count in generator exceeded.");
   }
   continue;
  }
  result.add(d);
 }
 return result;
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-data-generator

/**
 * Generate the given number of additional points.
 *
 * @see de.lmu.ifi.dbs.elki.data.synthetic.bymodel.GeneratorInterface#generate(int)
 */
@Override
public List<double[]> generate(int count) {
 ArrayList<double[]> result = new ArrayList<>(count);
 while(result.size() < count) {
  double[] d = new double[dim];
  for(int i = 0; i < dim; i++) {
   d[i] = axes.get(i).nextRandom();
  }
  if(trans != null) {
   d = trans.apply(d);
  }
  if(testClipping(d)) {
   if(--retries < 0) {
    throw new AbortException("Maximum retry count in generator exceeded.");
   }
   continue;
  }
  result.add(d);
 }
 return result;
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki

/**
 * Generate the given number of additional points.
 * 
 * @see de.lmu.ifi.dbs.elki.data.synthetic.bymodel.GeneratorInterface#generate(int)
 */
@Override
public List<Vector> generate(int count) throws UnableToComplyException {
 ArrayList<Vector> result = new ArrayList<>(count);
 while(result.size() < count) {
  double[] d = new double[dim];
  int i = 0;
  for(Distribution axis : axes) {
   d[i] = axis.nextRandom();
   i++;
  }
  Vector p = new Vector(d);
  if(trans != null) {
   p = trans.apply(p);
  }
  if(testClipping(p)) {
   retries--;
   if(retries < 0) {
    throw new UnableToComplyException("Maximum retry count in generator exceeded.");
   }
   continue;
  }
  result.add(p);
 }
 return result;
}

代码示例来源:origin: elki-project/elki

public void checkRandom(Distribution d, int size, double err) {
  double[] data = new double[size];
  for(int i = 0; i < size; i++) {
   data[i] = d.nextRandom();
  }
  Arrays.sort(data);
  final double q0 = d.cdf(data[0]);
  final double q50 = d.cdf(data[size >> 1]);
  final double q100 = d.cdf(data[size - 1]);
  assertEquals("0% quantile not as expected.", .5 / size, q0, err);
  assertEquals("50% quantile not as expected.", 0.5, q50, err);
  assertEquals("100% quantile not as expected.", 1. - .5 / size, q100, err);
  int errlev0 = (int) Math.ceil(Math.log10(Math.abs(.5 / size - q0)));
  int errlev50 = (int) Math.ceil(Math.log10(Math.abs(0.5 - q50)));
  int errlev100 = (int) Math.ceil(Math.log10(Math.abs(1 - .5 / size - q100)));
  int errlev = MathUtil.max(errlev0, errlev50, errlev100);
  assertEquals("Error magnitude is not tight", errlev, Math.log10(err), 0.1);
 }
}

代码示例来源:origin: elki-project/elki

if(Double.isNaN(v.doubleValue(i))) {
 ro = ro != null ? ro : v.toArray();
 ro[i] = dist.nextRandom();

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-input

if(Double.isNaN(v.doubleValue(i))) {
 ro = ro != null ? ro : v.toArray();
 ro[i] = dist.nextRandom();

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki

ro = v.getColumnVector().getArrayRef();
ro[i] = dist.nextRandom();

代码示例来源:origin: elki-project/elki

@Test
public void testParameterizer() throws ClassInstantiationException {
 ListParameterization params = new ListParameterization();
 params.addParameter(ConstantDistribution.Parameterizer.CONSTANT_ID, 2.);
 Distribution dist = ClassGenericsUtil.parameterizeOrAbort(ConstantDistribution.class, params);
 assertEquals(dist.nextRandom(), 2, 0.);
}

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki-input

if(Double.isNaN(v.doubleValue(d))) {
 ro = ro != null ? ro : v.toArray();
 ro[d] = dist.nextRandom();

代码示例来源:origin: elki-project/elki

ro = v.toArray();
ro[d] = dist.nextRandom();

代码示例来源:origin: de.lmu.ifi.dbs.elki/elki

ro = v.getColumnVector().getArrayRef();
ro[d] = dist.nextRandom();

相关文章