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

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

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

Distribution.quantile介绍

[英]Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.
[中]分位数aka probit(正常)aka逆CDF(invcdf,CDF^-1)函数。

代码示例

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

@Override
 public double[] computeMean() {
  double[] v = new double[dim];
  for(int i = 0; i < dim; i++) {
   v[i] = axes.get(i).quantile(0.5);
  }
  if(trans != null) {
   v = trans.apply(v);
  }
  return v;
 }
}

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

@Override
 public double[] computeMean() {
  double[] v = new double[dim];
  for(int i = 0; i < dim; i++) {
   v[i] = axes.get(i).quantile(0.5);
  }
  if(trans != null) {
   v = trans.apply(v);
  }
  return v;
 }
}

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

public void checkQuantile(Distribution d, String key, double err) {
 double[] data = this.data.get(key);
 assertEquals("Not NaN for NaN", Double.NaN, d.quantile(Double.NaN), 0.);
 assertEquals("Not NaN for -inf", Double.NaN, d.quantile(Double.NEGATIVE_INFINITY), 0.);
 assertEquals("Not NaN for -1", Double.NaN, d.quantile(-1), 0.);
 assertEquals("Not NaN for 2", Double.NaN, d.quantile(2), 0.);
 assertEquals("Not NaN for inf", Double.NaN, d.quantile(Double.POSITIVE_INFINITY), 0.);
 assertNotNull("Key not in test data: " + key, data);
 int maxerrlev = -15;
 for(int i = 0; i < data.length;) {
  double x = data[i++], exp = data[i++];
  if(Double.isNaN(exp)) {
   continue;
  }
  double val = d.quantile(x);
  if(val == exp) {
   continue;
  }
  double diff = Math.abs(val - exp);
  final int errlev = (int) Math.ceil(Math.log10(diff / exp));
  maxerrlev = Math.max(errlev, maxerrlev);
  if(diff < err || diff / exp < err) {
   continue;
  }
  assertEquals("Error magnitude: 1e" + errlev + " at " + x, exp, val, err);
 }
 int given = (int) Math.floor(Math.log10(err * 1.1));
 assertTrue("Error magnitude is not tight: measured " + maxerrlev + " specified " + given, given <= maxerrlev);
}

相关文章