List of usage examples for org.apache.commons.math.distribution TDistributionImpl density
@Override public double density(double x)
From source file:dr.evomodel.epidemiology.casetocase.periodpriors.NormalPeriodPriorDistribution.java
public double calculateLogPosteriorPredictiveProbability(double value) { double mean = currentParameters[0]; double sd = Math.sqrt( currentParameters[3] * (currentParameters[1] + 1) / (currentParameters[2] * currentParameters[1])); double scaledValue = (value - mean) / sd; double out;/*from ww w .j ava 2 s . co m*/ if (2 * currentParameters[2] <= normalApproximationThreshold) { TDistributionImpl tDist = new TDistributionImpl(2 * currentParameters[2]); out = Math.log(tDist.density(scaledValue)); } else { out = NormalDistribution.logPdf(scaledValue, 0, 1); } return out; }
From source file:org.caleydo.view.tourguide.impl.PAGEAlgorithm.java
@Override protected float computePValueImpl(Set<Integer> geneSet, IProgressMonitor monitor) { float z = compute(geneSet, monitor); if (Float.isNaN(z)) return Float.NaN; int m = Sets.intersection(foldChanges.keySet(), geneSet).size(); if (m == 0)/*w w w . ja va2s. c o m*/ return Float.NaN; TDistributionImpl t = new TDistributionImpl(m); float pValue = (float) t.density(z); return pValue; }