|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.AbstractCondProbDistrib blog.distrib.ChooseFromArgs
public class ChooseFromArgs
CPD that takes a sequence of probabilities as parameters, and uses those probabilities to define a distribution over its arguments. The number of arguments must equal the number of probability parameters. Alternatively, a ChooseFromArgs CPD can be constructed with no parameters, in which case it expects a column vector of probabilities as its first argument and chooses from its remaining arguments.
Constructor Summary | |
---|---|
ChooseFromArgs(double[] probs)
Creates a ChooseFromArgs CPD with the given parameter vector. |
|
ChooseFromArgs(java.util.List params)
Creates a new ChooseFromArgs distribution from the given parameter list. |
Method Summary | |
---|---|
double |
getProb(java.util.List args,
java.lang.Object childValue)
Returns the probability of the given child value conditioned on the given argument values. |
java.lang.Object |
sampleVal(java.util.List args,
Type childType)
Returns a value sampled according to 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 ChooseFromArgs(double[] probs)
public ChooseFromArgs(java.util.List params)
Method Detail |
---|
public double getProb(java.util.List args, java.lang.Object childValue)
java.lang.IllegalArgumentException
- if the probability vector was not
specified at construction and the
first argument is not a column
vector of probabilitiespublic java.lang.Object sampleVal(java.util.List args, Type childType)
java.lang.IllegalArgumentException
- if the probability vector was not
specified at construction and the
first argument is not a column
vector of probabilities
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |