public class MultinomialDistribution extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
private int |
dimension |
private int |
numSamples |
private double[] |
probabilities |
Constructor and Description |
---|
MultinomialDistribution(int n,
double[] p)
Creates a MultinomialDist object with parameters numSamples and (probabilities1,...,probabilitiesd) such that
∑i=1dprobabilitiesi = 1.
|
Modifier and Type | Method and Description |
---|---|
int |
getN()
Returns the parameter N of this object.
|
double[] |
getP()
Returns the parameters (probabilities1,...,probabilitiesd) of this object.
|
double |
prob(int[] x)
Returns the probability mass function
p(x1, x2,…, xd),
which should be a real number in [0, 1].
|
String |
toString() |
private int numSamples
private double[] probabilities
private int dimension
public MultinomialDistribution(int n, double[] p)
n
- the number of samples.p
- the array of probabilitiespublic final int getN()
public final double[] getP()
public final double prob(int[] x)
x
- value at which the mass function must be evaluatedCopyright © 2015 University of Glasgow. All rights reserved.