jsat.distributions.multivariate
Interface MultivariateDistribution
-
- All Superinterfaces:
- java.lang.Cloneable, java.io.Serializable
- All Known Implementing Classes:
- Dirichlet, EMGaussianMixture, MetricKDE, MultivariateDistributionSkeleton, MultivariateKDE, NormalM, NormalMR, ProductKDE, SymmetricDirichlet
public interface MultivariateDistribution extends java.lang.Cloneable, java.io.SerializableThis interface represents the contract that any continuous multivariate distribution must implement
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method and Description MultivariateDistributionclone()default doublelogPdf(double... x)Computes the log of the probability density function.doublelogPdf(Vec x)Computes the log of the probability density function.default doublepdf(double... x)Returns the probability of a given vector from this distribution.default doublepdf(Vec x)Returns the probability of a given vector from this distribution.java.util.List<Vec>sample(int count, java.util.Random rand)Performs sampling on the current distribution.default booleansetUsingData(DataSet dataSet)Sets the parameters of the distribution to attempt to fit the given list of data points.default booleansetUsingData(DataSet dataSet, boolean parallel)Sets the parameters of the distribution to attempt to fit the given list of data points.default <V extends Vec>
booleansetUsingData(java.util.List<V> dataSet)Sets the parameters of the distribution to attempt to fit the given list of vectors.<V extends Vec>
booleansetUsingData(java.util.List<V> dataSet, boolean parallel)Sets the parameters of the distribution to attempt to fit the given list of vectors.default booleansetUsingDataList(java.util.List<DataPoint> dataPoints)Sets the parameters of the distribution to attempt to fit the given list of data points.
-
-
-
Method Detail
-
logPdf
default double logPdf(double... x)
Computes the log of the probability density function. If the probability of the input is zero, the log of zero would beDouble.NEGATIVE_INFINITY. Instead, -Double.MAX_VALUEis returned.- Parameters:
x- the array for the vector the get the log probability of- Returns:
- the log of the probability.
- Throws:
java.lang.ArithmeticException- if the vector is not the correct length, or the distribution has not yet been set
-
logPdf
double logPdf(Vec x)
Computes the log of the probability density function. If the probability of the input is zero, the log of zero would beDouble.NEGATIVE_INFINITY. Instead, -Double.MAX_VALUEis returned.- Parameters:
x- the vector the get the log probability of- Returns:
- the log of the probability.
- Throws:
java.lang.ArithmeticException- if the vector is not the correct length, or the distribution has not yet been set
-
pdf
default double pdf(double... x)
Returns the probability of a given vector from this distribution. By definition, the probability will always be in the range [0, 1].- Parameters:
x- the array of the vector the get the log probability of- Returns:
- the probability
- Throws:
java.lang.ArithmeticException- if the vector is not the correct length, or the distribution has not yet been set
-
pdf
default double pdf(Vec x)
Returns the probability of a given vector from this distribution. By definition, the probability will always be in the range [0, 1].- Parameters:
x- the vector the get the log probability of- Returns:
- the probability
- Throws:
java.lang.ArithmeticException- if the vector is not the correct length, or the distribution has not yet been set
-
setUsingData
default <V extends Vec> boolean setUsingData(java.util.List<V> dataSet)
Sets the parameters of the distribution to attempt to fit the given list of vectors. All vectors are assumed to have the same weight.- Type Parameters:
V- the vector type- Parameters:
dataSet- the list of data points- Returns:
- true if the distribution was fit to the data, or false if the distribution could not be fit to the data set.
-
setUsingData
<V extends Vec> boolean setUsingData(java.util.List<V> dataSet, boolean parallel)
Sets the parameters of the distribution to attempt to fit the given list of vectors. All vectors are assumed to have the same weight.- Type Parameters:
V- the vector type- Parameters:
dataSet- the list of data pointsparallel-trueif the training should be done using multiple-cores,falsefor single threaded.- Returns:
- true if the distribution was fit to the data, or false if the distribution could not be fit to the data set.
-
setUsingDataList
default boolean setUsingDataList(java.util.List<DataPoint> dataPoints)
Sets the parameters of the distribution to attempt to fit the given list of data points. Theweightsof the data points will be used.- Parameters:
dataPoints- the list of data points to use- Returns:
- true if the distribution was fit to the data, or false if the distribution could not be fit to the data set.
-
setUsingData
default boolean setUsingData(DataSet dataSet)
Sets the parameters of the distribution to attempt to fit the given list of data points. Theweightsof the data points will be used.- Parameters:
dataSet- the data set to use- Returns:
- true if the distribution was fit to the data, or false if the distribution could not be fit to the data set.
-
setUsingData
default boolean setUsingData(DataSet dataSet, boolean parallel)
Sets the parameters of the distribution to attempt to fit the given list of data points. Theweightsof the data points will be used.- Parameters:
dataSet- the data set to useparallel- the source of threads for computation- Returns:
- true if the distribution was fit to the data, or false if the distribution could not be fit to the data set.
-
clone
MultivariateDistribution clone()
-
sample
java.util.List<Vec> sample(int count, java.util.Random rand)
Performs sampling on the current distribution.- Parameters:
count- the number of iid samples to drawrand- the source of randomness- Returns:
- a list of sample vectors from this distribution
-
-
DataMelt 3.0 © DataMelt by jWork.ORG