|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blog.AbstractCondProbDistrib blog.distrib.UnivarGaussian
public class UnivarGaussian
Gaussian (normal) distribution over real numbers. This CPD can be
initialized with zero, one, or two parameters. If two parameters
are given, then the first is the mean and the second is the
variance. If only one parameter is given, it is interpreted as the
variance, and the getProb
and sampleVal
methods will expect one argument specifying the mean. If no
parameters are given, then those methods will expect two arguments,
the mean and the variance.
Field Summary | |
---|---|
static UnivarGaussian |
STANDARD
|
Constructor Summary | |
---|---|
UnivarGaussian(double mean,
double variance)
Creates a univariate Gaussian distribution with the given fixed mean and variance. |
|
UnivarGaussian(java.util.List params)
Creates a univariate Gaussian distribution. |
Method Summary | |
---|---|
double |
getLogProb(double x)
Returns the natural log of the density of this Gaussian distribution at the given value. |
double |
getLogProb(java.util.List args,
java.lang.Object value)
Returns the natural log of the value returned by getProb. |
double |
getProb(double x)
Returns the density of this Gaussian distribution at the given value. |
double |
getProb(java.util.List args,
java.lang.Object value)
For a discrete distribution, returns the conditional probability of childValue given the argument values args . |
double |
sampleVal()
Returns a value sampled from this Gaussian distribution. |
java.lang.Object |
sampleVal(java.util.List args,
Type childType)
Samples a value according to this CPD given the args
. |
Methods inherited from class blog.AbstractCondProbDistrib |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final UnivarGaussian STANDARD
Constructor Detail |
---|
public UnivarGaussian(double mean, double variance)
public UnivarGaussian(java.util.List params)
getProb
and sampleVal
.
Method Detail |
---|
public double getProb(java.util.List args, java.lang.Object value)
CondProbDistrib
childValue
given the argument values args
.
For a continuous distribution, returns the conditional probability
density at childValue
.
public double getLogProb(java.util.List args, java.lang.Object value)
CondProbDistrib
getLogProb
in interface CondProbDistrib
getLogProb
in class AbstractCondProbDistrib
public double getProb(double x)
initParams
is called first).
public double getLogProb(double x)
initParams
has been called.
public java.lang.Object sampleVal(java.util.List args, Type childType)
CondProbDistrib
args
. The object returned should be of the specified type.
public double sampleVal()
initParams
is called first).
The implementation uses the Box-Muller transformation [G.E.P. Box and M.E. Muller (1958) "A note on the generation of random normal deviates". Ann. Math. Stat 29:610-611]. See also http://www.cs.princeton.edu/introcs/26function/MyMath.java.html
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |