jsat.distributions
Class ContinuousDistribution
- java.lang.Object
-
- jsat.distributions.Distribution
-
- jsat.distributions.ContinuousDistribution
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- Beta, Cauchy, ChiSquared, Exponential, FisherSendor, Gamma, KernelDensityEstimator, Kolmogorov, Kumaraswamy, Laplace, Levy, Logistic, LogNormal, LogUniform, MaxwellBoltzmann, Normal, Pareto, Rayleigh, StudentT, TruncatedDistribution, Uniform, Weibull
public abstract class ContinuousDistribution extends Distribution
The ContinuousDistribution represents the contract for a continuous in one dimension.
Many of the functions of a Continuous Distribution are implemented by default using numerical calculation and integration. For this reason, the base implementations may be slower or less accurate than desired - and could produce incorrect results for poorly behaved functions or large magnitude inputs. These base implementations are provided for easy completeness, but may not be appropriate for all methods. If needed, the implementer should check if these methods provide the needed level of accuracy and speed.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ContinuousDistribution()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description doublecdf(double x)Computes the value of the Cumulative Density Function (CDF) at the given point.abstract ContinuousDistributionclone()abstract double[]getCurrentVariableValues()Returns an array, where each value contains the value of a parameter in the distribution.java.lang.StringgetDescriptiveName()The descriptive name of a distribution returns the name of the distribution, followed by the parameters of the distribution and their values.abstract java.lang.StringgetDistributionName()Return the name of the distribution.abstract java.lang.String[]getVariables()Returns an array, where each value contains the name of a parameter in the distribution.doubleinvCdf(double p)Computes the inverse Cumulative Density Function (CDF-1) at the given point.doublelogPdf(double x)Computes the log of the Probability Density Function.doublemean()Computes the mean value of the distributiondoublemode()Computes the mode of the distribution.abstract doublepdf(double x)Computes the value of the Probability Density Function (PDF) at the given pointabstract voidsetUsingData(Vec data)Attempts to set the variables used by this distribution based on population sample data, assuming the sample data is from this type of distribution.abstract voidsetVariable(java.lang.String var, double value)Sets one of the variables of this distribution by the name.doubleskewness()Computes the skewness of the distribution.java.lang.StringtoString()doublevariance()Computes the variance of the distribution.-
Methods inherited from class jsat.distributions.Distribution
max, median, min, sample, sampleVec, standardDeviation
-
-
-
-
Method Detail
-
logPdf
public double logPdf(double x)
Computes the log of the Probability Density Function. Note, that then the probability is zero,Double.NEGATIVE_INFINITYwould be the true value. Instead, this method will always return the negative ofDouble.MAX_VALUE. This is to avoid propagating bad values through computation.- Parameters:
x- the value to get the log(PDF) of- Returns:
- the value of log(PDF(x))
-
pdf
public abstract double pdf(double x)
Computes the value of the Probability Density Function (PDF) at the given point- Parameters:
x- the value to get the PDF- Returns:
- the PDF(x)
-
cdf
public double cdf(double x)
Description copied from class:DistributionComputes 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.- Specified by:
cdfin classDistribution- Parameters:
x- the value to get the CDF of- Returns:
- the CDF(x)
-
invCdf
public double invCdf(double p)
Description copied from class:DistributionComputes 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- Overrides:
invCdfin classDistribution- Parameters:
p- the probability value- Returns:
- the value such that the CDF would return p
-
mean
public double mean()
Description copied from class:DistributionComputes the mean value of the distribution- Specified by:
meanin classDistribution- Returns:
- the mean value of the distribution
-
variance
public double variance()
Description copied from class:DistributionComputes 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.- Specified by:
variancein classDistribution- Returns:
- the variance of the distribution.
-
skewness
public double skewness()
Description copied from class:DistributionComputes 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.- Specified by:
skewnessin classDistribution- Returns:
- the skewness of the distribution.
-
mode
public double mode()
Description copied from class:DistributionComputes 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.- Specified by:
modein classDistribution- Returns:
- the mode of the distribution
-
getDescriptiveName
public java.lang.String getDescriptiveName()
The descriptive name of a distribution returns the name of the distribution, followed by the parameters of the distribution and their values.- Returns:
- the name of the distribution that includes parameter values
-
getDistributionName
public abstract java.lang.String getDistributionName()
Return the name of the distribution.- Returns:
- the name of the distribution.
-
getVariables
public abstract java.lang.String[] getVariables()
Returns an array, where each value contains the name of a parameter in the distribution. The order must always be the same, and match up with the values returned bygetCurrentVariableValues()- Returns:
- a string of the variable names this distribution uses
-
getCurrentVariableValues
public abstract double[] getCurrentVariableValues()
Returns an array, where each value contains the value of a parameter in the distribution. The order must always be the same, and match up with the values returned bygetVariables()- Returns:
- the current values of the parameters used by this distribution, in the same order as their names are returned by
getVariables()
-
setVariable
public abstract void setVariable(java.lang.String var, double value)Sets one of the variables of this distribution by the name.- Parameters:
var- the variable to setvalue- the value to set
-
clone
public abstract ContinuousDistribution clone()
- Specified by:
clonein classDistribution
-
setUsingData
public abstract void setUsingData(Vec data)
Attempts to set the variables used by this distribution based on population sample data, assuming the sample data is from this type of distribution.- Parameters:
data- the data to use to attempt to fit against
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG