本文整理汇总了Java中cern.jet.random.ChiSquare类的典型用法代码示例。如果您正苦于以下问题:Java ChiSquare类的具体用法?Java ChiSquare怎么用?Java ChiSquare使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChiSquare类属于cern.jet.random包,在下文中一共展示了ChiSquare类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: assertWellBalanced
import cern.jet.random.ChiSquare; //导入依赖的package包/类
private void assertWellBalanced(int numNodes, Multiset<Integer> ids) {
// compute the chi-sq statistic
double expected = ids.size() / (double) numNodes;
double chiSq = 0.0;
int df = numNodes - 1;
NumberFormat prct = NumberFormat.getPercentInstance();
prct.setMaximumFractionDigits(4);
NumberFormat num = NumberFormat.getInstance();
num.setMaximumFractionDigits(4);
num.setMinimumFractionDigits(4);
System.out.println("node\treqs\tX^2\tskew");
for(Integer id: ids.elementSet()) {
System.out.println(id + "\t" + ids.count(id) + "\t"
+ num.format(chiSq(ids.count(id), expected)) + "\t"
+ prct.format((ids.count(id) - expected) / expected));
chiSq += chiSq(ids.count(id), expected);
}
System.out.println("X^2 = " + chiSq);
ChiSquare dist = new ChiSquare(df, new MersenneTwister());
// p-value is ~= prob of seeing this distribution from fair router
double pValue = 1.0 - dist.cdf(chiSq);
System.out.println("p-value = " + pValue);
assertTrue("Non-uniform load distribution detected.", pValue >= 0.05);
}
开发者ID:we7,项目名称:voldemort,代码行数:25,代码来源:ConsistentRoutingStrategyTest.java
示例2: EnrichmentSignificance
import cern.jet.random.ChiSquare; //导入依赖的package包/类
public EnrichmentSignificance(EventsConfig con, ExperimentManager exptman, BindingManager bman, double minFoldChange, double genomeLength){
this.config = con;
this.manager = exptman;
this.bindingManager = bman;
this.minFoldChange = minFoldChange;
this.genomeLength = genomeLength;
binomial = new Binomial(100, .5, new DRand());
poisson = new Poisson(1, new DRand());
chisquare = new ChiSquare(1, new DRand());
}
开发者ID:seqcode,项目名称:chexmix,代码行数:11,代码来源:EnrichmentSignificance.java
示例3: ChiSquareDistribution
import cern.jet.random.ChiSquare; //导入依赖的package包/类
/**
* @param degrees The degrees of freedom of the distribution, not less than one
* @param engine A uniform random number generator, not null
*/
public ChiSquareDistribution(final double degrees, final RandomEngine engine) {
Validate.isTrue(degrees >= 1, "Degrees of freedom must be greater than or equal to one");
Validate.notNull(engine);
_chiSquare = new ChiSquare(degrees, engine);
_degrees = degrees;
}
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:11,代码来源:ChiSquareDistribution.java
示例4: EnrichmentSignificance
import cern.jet.random.ChiSquare; //导入依赖的package包/类
public EnrichmentSignificance(Config con, ExperimentSet exptSet, List<BindingEvent> features, double minFoldChange, double genomeLength){
this.config = con;
this.exptSet = exptSet;
this.features = features;
this.minFoldChange = minFoldChange;
this.genomeLength = genomeLength;
binomial = new Binomial(100, .5, new DRand());
poisson = new Poisson(1, new DRand());
chisquare = new ChiSquare(1, new DRand());
}
开发者ID:shaunmahony,项目名称:multigps-archive,代码行数:11,代码来源:EnrichmentSignificance.java
示例5: ExperienceSanityCheck
import cern.jet.random.ChiSquare; //导入依赖的package包/类
ExperienceSanityCheck() {
freedom = 6; // osi x
k = 15;
chi = new ChiSquare(freedom,
cern.jet.random.ChiSquare.makeDefaultGenerator());
// sigmoidCurve = new SigmoidCurve();
checkChi();
checkSigmoid();
EpsilonCutValue = checkEpsilonFromChi();
}
开发者ID:wikiteams,项目名称:aon-emerging-wikiteams,代码行数:14,代码来源:Experience.java
示例6: sampleVar
import cern.jet.random.ChiSquare; //导入依赖的package包/类
public double sampleVar() {
double diff = (double)(getN() - getK());
ChiSquare chiSquare = new cern.jet.random.ChiSquare(diff, engine);
double x = chiSquare.nextDouble();
return (diff * s2) / x;
}
开发者ID:seqcode,项目名称:seqcode-core,代码行数:7,代码来源:DataRegression.java
示例7: LearningCurve
import cern.jet.random.ChiSquare; //导入依赖的package包/类
LearningCurve() {
say("Object LearningCurve created, with ref: " + this);
chi = new ChiSquare(freedom,
cern.jet.random.ChiSquare.makeDefaultGenerator());
}
开发者ID:wikiteams,项目名称:aon-emerging-wikiteams,代码行数:6,代码来源:Experience.java
注:本文中的cern.jet.random.ChiSquare类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论