|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.AbstractCondProbDistrib blog.distrib.NatNumDistribWithTail
public class NatNumDistribWithTail
A mixture of an explicit distribution over the first k natural numbers 0,...,(k-1), and a geometric distribution over the numbers greater than or equal to k. This distribution takes three parameters: a column vector of k probabilities for the first k numbers, the probability lambda that the value is less than k, and the success parameter alpha of the geometric distribution.
Constructor Summary | |
---|---|
NatNumDistribWithTail(double[] pi,
double lambda,
double alpha)
Creates a NatNumDistribWithTail with the given array of probabilities for the multinomial distribution, and the given lambda and alpha values. |
|
NatNumDistribWithTail(java.util.List params)
Creates a new NatNumDistribWithTail with the following three parameters: a k-by-1 matrix specifying a probability distribution over the first k natural numbers the probability of generating a number less than k the success probability of the geometric distribution for values greater than or equal to k |
Method Summary | |
---|---|
double |
getLogProb(int n)
Returns the log probability of a non-negative integer n under this distribution. |
double |
getProb(int n)
Returns the probability of a non-negative integer n under this distribution. |
double |
getProb(java.util.List args,
java.lang.Object childValue)
Returns the probability of the given value, which should be a non-negative Integer. |
int |
sampleVal()
Returns a sample from this distribution. |
java.lang.Object |
sampleVal(java.util.List args,
Type childType)
Returns an Integer sampled from this distribution. |
Methods inherited from class blog.AbstractCondProbDistrib |
---|
getLogProb, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NatNumDistribWithTail(double[] pi, double lambda, double alpha)
pi
- an array of double values specifying a probability
distribution over the first pi.length natural numberslambda
- the probability P(X < pi.length)alpha
- the success probability of the geometric distribution:
P(X >= n+1 | X >= n) for n >= pi.lengthpublic NatNumDistribWithTail(java.util.List params)
Method Detail |
---|
public double getProb(int n)
public double getLogProb(int n)
public double getProb(java.util.List args, java.lang.Object childValue)
public int sampleVal()
public java.lang.Object sampleVal(java.util.List args, Type childType)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |