jsat.distributions
Class Distribution
- java.lang.Object
-
- jsat.distributions.Distribution
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- ContinuousDistribution, DiscreteDistribution
public abstract class Distribution extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableBase distribution class for distributions that have only one input.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description Distribution()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract doublecdf(double x)Computes the value of the Cumulative Density Function (CDF) at the given point.abstract Distributionclone()doubleinvCdf(double p)Computes the inverse Cumulative Density Function (CDF-1) at the given point.abstract doublemax()The maximum value for which the#pdf(double)is meant to return a value.abstract doublemean()Computes the mean value of the distributiondoublemedian()Computes the median value of the distributionabstract doublemin()The minimum value for which the#pdf(double)is meant to return a value.abstract doublemode()Computes the mode of the distribution.double[]sample(int numSamples, java.util.Random rand)This method returns a double array containing the values of random samples from this distribution.DenseVectorsampleVec(int numSamples, java.util.Random rand)This method returns a double array containing the values of random samples from this distribution.abstract doubleskewness()Computes the skewness of the distribution.doublestandardDeviation()Computes the standard deviation of the distribution.abstract doublevariance()Computes the variance of the distribution.
-
-
-
Method Detail
-
cdf
public abstract double cdf(double x)
Computes the value of the Cumulative Density Function (CDF) at the given point. The CDF returns a value in the range [0, 1], indicating what portion of values occur at or below that point.- Parameters:
x- the value to get the CDF of- Returns:
- the CDF(x)
-
invCdf
public double invCdf(double p)
Computes the inverse Cumulative Density Function (CDF-1) at the given point. It takes in a value in the range of [0, 1] and returns the value x, such that CDF(x) = p- Parameters:
p- the probability value- Returns:
- the value such that the CDF would return p
-
mean
public abstract double mean()
Computes the mean value of the distribution- Returns:
- the mean value of the distribution
-
median
public double median()
Computes the median value of the distribution- Returns:
- the median value of the distribution
-
mode
public abstract double mode()
Computes the mode of the distribution. Not all distributions have a mode for all parameter values.NaNmay be returned if the mode is not defined for the current values of the distribution.- Returns:
- the mode of the distribution
-
variance
public abstract double variance()
Computes the variance of the distribution. Not all distributions have a finite variance for all parameter values.NaNmay be returned if the variance is not defined for the current values of the distribution.Infinityis a possible value to be returned by some distributions.- Returns:
- the variance of the distribution.
-
skewness
public abstract double skewness()
Computes the skewness of the distribution. Not all distributions have a finite skewness for all parameter values.NaNmay be returned if the skewness is not defined for the current values of the distribution.- Returns:
- the skewness of the distribution.
-
standardDeviation
public double standardDeviation()
Computes the standard deviation of the distribution. Not all distributions have a finite standard deviation for all parameter values.NaNmay be returned if the variance is not defined for the current values of the distribution.Infinityis a possible value to be returned by some distributions.- Returns:
- the standard deviation of the distribution
-
min
public abstract double min()
The minimum value for which the#pdf(double)is meant to return a value. Note thatDouble.NEGATIVE_INFINITYis a valid return value.- Returns:
- the minimum value for which the
#pdf(double)is meant to return a value.
-
max
public abstract double max()
The maximum value for which the#pdf(double)is meant to return a value. Note thatDouble.POSITIVE_INFINITYis a valid return value.- Returns:
- the maximum value for which the
#pdf(double)is meant to return a value.
-
sample
public double[] sample(int numSamples, java.util.Random rand)This method returns a double array containing the values of random samples from this distribution.- Parameters:
numSamples- the number of random samples to takerand- the source of randomness- Returns:
- an array of the random sample values
-
sampleVec
public DenseVector sampleVec(int numSamples, java.util.Random rand)
This method returns a double array containing the values of random samples from this distribution.- Parameters:
numSamples- the number of random samples to takerand- the source of randomness- Returns:
- a vector of the random sample values
-
clone
public abstract Distribution clone()
- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG