|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mahout.clustering.dirichlet.UncommonDistributions
public final class UncommonDistributions
| Field Summary | |
|---|---|
static double |
SQRT2PI
|
| Method Summary | |
|---|---|
static double |
dNorm(double x,
double m,
double s)
Return the normal density function value for the sample x pdf = 1/[sqrt(2*p)*s] * e^{-1/2*[(x-m)/s]^2} |
static double |
rBeta(double shape1,
double shape2)
Returns a random sample from a beta distribution with the given shapes |
static Vector |
rBeta(int k,
double shape1,
double shape2)
Returns a vector of random samples from a beta distribution with the given shapes |
static int |
rBinomial(int n,
double p)
Returns an integer sampled according to this distribution. |
static double |
rChisq(double df)
Return a random sample from the chi-squared (chi^2) distribution with df degrees of freedom. |
static Vector |
rDirichlet(Vector totalCounts,
double alpha0)
Sample from a Dirichlet distribution, returning a vector of probabilities using a stick-breaking algorithm |
static double |
rGamma(double k,
double lambda)
Returns a double sampled according to this distribution. |
static Vector |
rMultinom(int size,
Vector probabilities)
Returns a multinomial vector sampled from the given probabilities rmultinom should be implemented as successive binomial sampling. |
static int |
rMultinom(Vector probabilities)
Returns one sample from a multinomial. |
static double |
rNorm(double mean,
double sd)
Return a random value from a normal distribution with the given mean and standard deviation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double SQRT2PI
| Method Detail |
|---|
public static double rGamma(double k,
double lambda)
public static double rBeta(double shape1,
double shape2)
shape1 - a double representing shape1shape2 - a double representing shape2
public static Vector rBeta(int k,
double shape1,
double shape2)
k - the number of samples to returnshape1 - a double representing shape1shape2 - a double representing shape2
public static double rChisq(double df)
public static double rNorm(double mean,
double sd)
mean - a double mean valuesd - a double standard deviation
public static double dNorm(double x,
double m,
double s)
x - a double sample valuem - a double mean values - a double standard deviation
public static int rMultinom(Vector probabilities)
public static Vector rMultinom(int size,
Vector probabilities)
size - the size parameter of the binomial distributionprobabilities - a Vector of probabilities
public static int rBinomial(int n,
double p)
public static Vector rDirichlet(Vector totalCounts,
double alpha0)
totalCounts - an unnormalized count Vectoralpha0 - a double
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||