|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.cs.sb.core.StatUtil
public class StatUtil
The class implements static methods to compute values related to the binomial, hypergeometric, and normal distribution
Field Summary | |
---|---|
static java.util.Hashtable |
htbinom
this hashtable caches previously computed binomial coefficient values so they do not need to be recomputed |
static double |
TWOPISQRT
Sqrt of 2 times PI |
Constructor Summary | |
---|---|
StatUtil()
|
Method Summary | |
---|---|
static double |
binomialcumulative(double x,
double dN,
double dp)
Computes the probability of seeing x or fewer successes in dN trials where the probability of a success is dp. |
static double |
binomialtail(int x,
int N,
double dp)
Computes the probability of seeing more than x successes in N trials where the probability of a success is dp. |
static double |
hypergeometric(int nx,
int nA,
int nB,
int nm)
Returns the probability of seeing x of type A, when there nA objects of type A nB objects of type B, and nm objects total drawn |
static double |
hypergeometriccumulativex(int nx,
int nA,
int nB,
int nm)
Returns the probability of seeing x or fewer objects of type A, when there are nA objects of type A nB objects of type B, and nm objects total drawn |
static double |
hypergeometrictail(int nx,
int nA,
int nB,
int nm)
Returns the probability of seeing more than x objects of type A, when there are nA objects of type A nB objects of type B, and nm objects total drawn This can be used to compute a more accurate p-values than a 1-cumulative probability calculation |
static double |
logbinomcoeff(int ni,
int N)
Returns the log of the binomial coefficient N choose ni |
static double |
normaldensity(double x,
double dmu,
double dsigma)
computes the value of f(x) where f is a density for a normal distribution with mean dmu and standard deviation dsigma. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.Hashtable htbinom
public static double TWOPISQRT
Constructor Detail |
---|
public StatUtil()
Method Detail |
---|
public static double logbinomcoeff(int ni, int N)
public static double hypergeometric(int nx, int nA, int nB, int nm)
public static double hypergeometrictail(int nx, int nA, int nB, int nm)
public static double hypergeometriccumulativex(int nx, int nA, int nB, int nm)
public static double binomialcumulative(double x, double dN, double dp)
public static double binomialtail(int x, int N, double dp)
public static double normaldensity(double x, double dmu, double dsigma)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |