|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javaslam.prob.Sample
A utility class containing methods for sampling from various probability distributions. The implementations used here are borrowed directly from Tom Minka's Lightspeed library for Matlab.
This class records counts of all floating point operations using
Flops.count(long)
.
Field Summary | |
static double |
DBL_EPSILON
Analogous to eps in Matlab. |
Constructor Summary | |
Sample()
|
Method Summary | |
static double |
beta(double a,
double b,
Random r)
Returns a sample from Beta(a, b). |
static int |
binomial(int n,
double p,
Random r)
Returns a sample from Binomial(n, p). |
static double |
gamma(double a,
Random r)
Samples from the Gamma(a) distribution. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double DBL_EPSILON
Constructor Detail |
public Sample()
Method Detail |
public static double gamma(double a, Random r)
public static double beta(double a, double b, Random r)
public static int binomial(int n, double p, Random r)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |