@PublicationReference(author="Wikipedia", title="Multivariate Polya Distribution", type=WebPage, year=2010, url="http://en.wikipedia.org/wiki/Multivariate_Polya_distribution") public class MultivariatePolyaDistribution extends AbstractDistribution<Vector> implements ClosedFormComputableDiscreteDistribution<Vector>
| Modifier and Type | Class and Description |
|---|---|
static class |
MultivariatePolyaDistribution.PMF
PMF of the MultivariatePolyaDistribution
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_DIMENSIONALITY
Default dimensionality, 2.
|
static int |
DEFAULT_NUM_TRIALS
Default number of trials, 1.
|
protected Vector |
parameters
Parameters of the Dirichlet distribution, must be at least 2-dimensional
and each element must be positive.
|
| Constructor and Description |
|---|
MultivariatePolyaDistribution()
Creates a new instance of DirichletDistribution
|
MultivariatePolyaDistribution(int dimensionality,
int numTrials)
Creates a new instance of MultivariatePolyaDistribution
|
MultivariatePolyaDistribution(MultivariatePolyaDistribution other)
Copy Constructor.
|
MultivariatePolyaDistribution(Vector parameters,
int numTrials)
Creates a new instance of MultivariatePolyaDistribution
|
| Modifier and Type | Method and Description |
|---|---|
MultivariatePolyaDistribution |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
void |
convertFromVector(Vector parameters)
Converts the object from a Vector of parameters.
|
Vector |
convertToVector()
Converts the object to a vector.
|
MultinomialDistribution.Domain |
getDomain()
Returns an object that allows an iteration through the domain
(x-axis, independent variable) of the Distribution
|
int |
getDomainSize()
Gets the size of the domain.
|
int |
getInputDimensionality()
Gets the dimensionality of the parameters
|
Vector |
getMean()
Gets the arithmetic mean, or "first central moment" or "expectation",
of the distribution.
|
int |
getNumTrials()
Getter for numTrials
|
Vector |
getParameters()
Getter for parameters
|
MultivariatePolyaDistribution.PMF |
getProbabilityFunction()
Gets the distribution function associated with this Distribution,
either the PDF or PMF.
|
void |
sampleInto(java.util.Random random,
int sampleCount,
java.util.Collection<? super Vector> output)
Draws multiple random samples from the distribution and puts the result
into the given collection.
|
void |
setNumTrials(int numTrials)
Setter for numTrials
|
void |
setParameters(Vector parameters)
Setter for parameters
|
java.lang.String |
toString() |
sample, sampleequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsample, samplepublic static final int DEFAULT_NUM_TRIALS
public static final int DEFAULT_DIMENSIONALITY
protected Vector parameters
public MultivariatePolyaDistribution()
public MultivariatePolyaDistribution(int dimensionality,
int numTrials)
dimensionality - Dimensionality of the distributionnumTrials - Number of trials in the distribution, must be greater than 0.public MultivariatePolyaDistribution(Vector parameters, int numTrials)
parameters - Parameters of the Dirichlet distribution, must be at least 2-dimensional
and each element must be positive.numTrials - Number of trials in the distribution, must be greater than 0.public MultivariatePolyaDistribution(MultivariatePolyaDistribution other)
other - MultivariatePolyaDistribution to copy.public MultivariatePolyaDistribution clone()
AbstractCloneableSerializableObject class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone() to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone() as the basis for your implementation.clone in interface Vectorizableclone in interface CloneableSerializableclone in class AbstractCloneableSerializablepublic Vector getMean()
DistributionWithMeangetMean in interface DistributionWithMean<Vector>public void sampleInto(java.util.Random random,
int sampleCount,
java.util.Collection<? super Vector> output)
DistributionsampleInto in interface Distribution<Vector>random - Random number generator to use.sampleCount - The number of samples to draw. Cannot be negative.output - The collection to add the samples into.public int getNumTrials()
public void setNumTrials(int numTrials)
numTrials - Number of trials in the distribution, must be greater than 0.public MultivariatePolyaDistribution.PMF getProbabilityFunction()
ComputableDistributiongetProbabilityFunction in interface ComputableDistribution<Vector>getProbabilityFunction in interface DiscreteDistribution<Vector>public Vector convertToVector()
VectorizableconvertToVector in interface Vectorizablepublic void convertFromVector(Vector parameters)
VectorizableconvertFromVector in interface Vectorizableparameters - The parameters to incorporate.public int getInputDimensionality()
public Vector getParameters()
public void setParameters(Vector parameters)
parameters - Parameters of the Dirichlet distribution, must be at least 2-dimensional
and each element must be positive.public MultinomialDistribution.Domain getDomain()
DiscreteDistributiongetDomain in interface DiscreteDistribution<Vector>public int getDomainSize()
DiscreteDistributiongetDomainSize in interface DiscreteDistribution<Vector>public java.lang.String toString()
toString in class java.lang.Object