|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.AbstractCondProbDistrib blog.distrib.Binomial
public class Binomial
A Binomial distribution with parameters n (number of trials) and p (probability of success for a given trial). The probability of k successes P(k)= C(n,k) * p^k * (1-p)^(n-k). A Binomial distribution can be created in the following ways:
Constructor Summary | |
---|---|
Binomial(int n,
double p)
Creates a new Binomial distribution with parameters n and p. |
|
Binomial(java.util.List params)
Creates a new Binomial distribution. |
Method Summary | |
---|---|
double |
getLogProb(java.util.List args,
java.lang.Object value)
Returns the log of the probability of integer k under the distribution. |
double |
getProb(java.util.List args,
java.lang.Object value)
Returns the probability of integer k under this distribution. |
java.lang.Object |
sampleVal(java.util.List args,
Type childType)
Returns an integer sampled according to this distribution. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Binomial(int n, double p)
public Binomial(java.util.List params)
Method Detail |
---|
public double getProb(java.util.List args, java.lang.Object value)
public double getLogProb(java.util.List args, java.lang.Object value)
getLogProb
in interface CondProbDistrib
getLogProb
in class AbstractCondProbDistrib
public java.lang.Object sampleVal(java.util.List args, Type childType)
public java.lang.String toString()
toString
in class AbstractCondProbDistrib
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |