|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcommon.Bernoulli
public class Bernoulli
A distribution over {true, false}. It has one parameter, the probability
of the value true
.
Constructor Summary | |
---|---|
Bernoulli()
Creates a Bernoulli object with the probability of true
set to 0.5. |
|
Bernoulli(double p)
Creates a Bernoulli object with the probability of true
set to p . |
Method Summary | |
---|---|
void |
collectStats(boolean x)
Records an occurrence of the value x, for use in updating parameters. |
double |
getLogProb(boolean x)
Returns the log of the probability of the Boolean value x. |
double |
getProb(boolean x)
Returns the probability of the Boolean value x. |
double |
updateParams()
Sets the parameter probTrue to the value that maximizes the likelihood of the values passed to collectStats since the last call to updateParams. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Bernoulli()
true
set to 0.5.
public Bernoulli(double p)
true
set to p
.
java.lang.IllegalArgumentException
- if p < 0 or p > 1.Method Detail |
---|
public double getProb(boolean x)
public double getLogProb(boolean x)
public void collectStats(boolean x)
public double updateParams()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |