public class SymmetricDirichlet extends MultivariateDistributionSkeleton
Dirichlet
distribution, and occurs when all alphas have the same value.Constructor and Description |
---|
SymmetricDirichlet(double alpha,
int dim)
Creates a new Symmetric Dirichlet distribution.
|
Modifier and Type | Method and Description |
---|---|
SymmetricDirichlet |
clone() |
double |
getAlpha()
Returns the alpha value used by this distribution
|
int |
getDimension()
Returns the dimension size of the current distribution
|
double |
logPdf(Vec x)
Computes the log of the probability density function.
|
double |
pdf(Vec x)
Returns the probability of a given vector from this distribution.
|
List<Vec> |
sample(int count,
Random rand)
Performs sampling on the current distribution.
|
void |
setAlpha(double alpha)
Sets the alpha value used for the distribution
|
void |
setDimension(int dim)
Sets the dimension size of the distribution
|
<V extends Vec> |
setUsingData(List<V> dataSet)
Sets the parameters of the distribution to attempt to fit the given list of vectors.
|
boolean |
setUsingDataList(List<DataPoint> dataPoint)
Sets the parameters of the distribution to attempt to fit the given list of data points.
|
logPdf, pdf, setUsingData, setUsingData, setUsingData, setUsingDataList
public SymmetricDirichlet(double alpha, int dim)
alpha
- the positive alpha value for the distributiondim
- the dimension of the distribution.ArithmeticException
- if a non positive alpha or dimension value is givenpublic void setDimension(int dim)
dim
- the new dimension sizepublic int getDimension()
public void setAlpha(double alpha) throws ArithmeticException
alpha
- the positive value for the distributionArithmeticException
- if the value given is not a positive valuepublic double getAlpha()
public SymmetricDirichlet clone()
clone
in interface MultivariateDistribution
clone
in class MultivariateDistributionSkeleton
public double logPdf(Vec x)
MultivariateDistribution
Double.NEGATIVE_INFINITY
. Instead, -Double.MAX_VALUE
is returned.logPdf
in interface MultivariateDistribution
logPdf
in class MultivariateDistributionSkeleton
x
- the vector the get the log probability ofpublic double pdf(Vec x)
MultivariateDistribution
x
- the vector the get the log probability ofpublic <V extends Vec> boolean setUsingData(List<V> dataSet)
MultivariateDistribution
V
- the vector typedataSet
- the list of data pointspublic boolean setUsingDataList(List<DataPoint> dataPoint)
MultivariateDistribution
weights
of the data points will be used.dataPoint
- the list of data points to usepublic List<Vec> sample(int count, Random rand)
MultivariateDistribution
count
- the number of iid samples to drawrand
- the source of randomnessCopyright © 2017. All rights reserved.