本文整理汇总了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);
}
示例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());
}
示例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;
}
示例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());
}
示例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();
}
示例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;
}
示例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());
}