|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.AbstractCondProbDistrib blog.distrib.BoundedGeometric
public class BoundedGeometric
Like a geometric distribution, but with an upper bound B. The value B gets all the probability mass that would ordinarily go to numbers greater than or equal to B. The parameter alpha now denotes P(X >= n+1 | X >= n) only for n < B. The distribution is defined by:
P(X = n) = (1 - alpha) alpha^n for n < B P(X = B) = alpha^BThe alpha value should be given as a parameter, and the upper bound as an argument.
Constructor Summary | |
---|---|
BoundedGeometric(java.util.List params)
Creates a bounded geometric distribution with the given alpha parameter. |
Method Summary | |
---|---|
double |
getLogProb(int n)
Returns the natural log of the probability of the given integer under this distribution. |
double |
getLogProb(java.util.List args,
java.lang.Object value)
Returns the log probability of the given value, which should be an Integer. |
double |
getProb(int n)
Returns the probability of the given integer under this distribution. |
double |
getProb(java.util.List args,
java.lang.Object value)
Returns the probability of the given value, which should be an Integer. |
java.lang.Object |
sampleVal(java.util.List args,
Type childType)
Generates a sample from 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 BoundedGeometric(java.util.List params)
java.lang.IllegalArgumentException
- if alpha < 0 or alpha > 1.Method Detail |
---|
public double getProb(int n)
public double getProb(java.util.List args, java.lang.Object value)
public double getLogProb(int n)
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 |