public class NormalM extends MultivariateDistributionSkeleton
Constructor and Description |
---|
NormalM() |
NormalM(Vec mean,
Matrix covariance) |
Modifier and Type | Method and Description |
---|---|
NormalM |
clone() |
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 |
setCovariance(Matrix covMatrix)
Sets the covariance matrix for this matrix.
|
void |
setMeanCovariance(Vec mean,
Matrix covariance)
Sets the mean and covariance for this 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> dataSet)
Sets the parameters of the distribution to attempt to fit the given list of data points.
|
logPdf, pdf, setUsingData, setUsingData, setUsingData, setUsingDataList
public void setMeanCovariance(Vec mean, Matrix covariance)
mean
- the mean for the distribution. A copy will be used.covariance
- the covariance for this distribution. A copy will be used.ArithmeticException
- if the mean and covariance do not agree, or the covariance is not
positive definite. An exception may not be throw for all bad matrices.public void setCovariance(Matrix covMatrix)
covMatrix
- set the covariance matrix used for this distributionArithmeticException
- if the covariance matrix is not square,
does not agree with the mean, or is not positive definite. An
exception may not be throw for all bad matrices.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> dataSet)
MultivariateDistribution
weights
of the data points will be used.dataSet
- the list of data points to usepublic NormalM clone()
clone
in interface MultivariateDistribution
clone
in class MultivariateDistributionSkeleton
public List<Vec> sample(int count, Random rand)
MultivariateDistribution
count
- the number of iid samples to drawrand
- the source of randomnessCopyright © 2017. All rights reserved.