|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcommon.BinarySequenceDistrib
public class BinarySequenceDistrib
A distribution over sequences of independent, identically distributed binary variables. It has one parameter: the probability that any given element in the sequence is true.
Constructor Summary | |
---|---|
BinarySequenceDistrib()
Creates a BinarySequenceDistrib object with the probability of any element being true set to 0.5. |
|
BinarySequenceDistrib(double p)
Creates a BinarySequenceDistrib object with the probability of any element being true set to p . |
Method Summary | |
---|---|
void |
collectStats(java.util.BitSet s,
int n)
Records the occurrence of an array of length n, where the set of true elements is specified by the given BitSet. |
void |
collectStats(boolean[] x)
Records an occurrence of the array x, for use in updating parameters. |
double |
getLogProb(java.util.BitSet s,
int n)
Returns the log probability of an array of length n, where the set of true elements is specified by the given BitSet. |
double |
getLogProb(boolean[] x)
Returns the log of the probability of the given array of values. |
double |
getProb(java.util.BitSet s,
int n)
Returns the probability of an array of length n, where the set of true elements is specified by the given BitSet. |
double |
getProb(boolean[] x)
Returns the probability of the given array of values. |
double |
updateParams()
Sets the parameter probTrue to the value that maximizes the likelihood of the arrays 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 BinarySequenceDistrib()
true
set to 0.5.
public BinarySequenceDistrib(double p)
true
set to p
.
java.lang.IllegalArgumentException
- if p < 0 or p > 1.Method Detail |
---|
public double getProb(boolean[] x)
public double getProb(java.util.BitSet s, int n)
public double getLogProb(boolean[] x)
public double getLogProb(java.util.BitSet s, int n)
public void collectStats(boolean[] x)
public void collectStats(java.util.BitSet s, int n)
public double updateParams()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |