Package edu.cmu.tetrad.sem
Class EmpiricalCdf
java.lang.Object
edu.cmu.tetrad.sem.EmpiricalCdf
- All Implemented Interfaces:
- org.apache.commons.math3.distribution.RealDistribution
public class EmpiricalCdf
extends Object
implements org.apache.commons.math3.distribution.RealDistribution
Only the cumulativeProbability, density, setShift methods are implemented.
- Version:
- $Id: $Id
- Author:
- josephramsey
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondoublecumulativeProbability(double x) Calculates the cumulative probability of a given point.doublecumulativeProbability(double v, double v1) Deprecated.This method is deprecated and will be removed in a future release.doubledensity(double v) Calculates the probability density function (PDF) of a given point.doubleReturns the numerical mean of the empirical cumulative distribution function (CDF).doubleReturns the numerical variance of the empirical cumulative distribution function (CDF).doubleReturns the lower bound of the support for the distribution.doubleReturns the upper bound of the support for the distribution.doubleinverseCumulativeProbability(double v) Calculates the inverse cumulative probability of a given point.booleanReturns a boolean indicating whether the support of the distribution is connected or not.booleanDeprecated.This method is deprecated and will be removed in a future release.booleanDeprecated.This method is deprecated and will be removed in a future release.doubleprobability(double v) Calculates the probability mass function (PMF) of a given point.voidreseedRandomGenerator(long l) Reseeds the random number generator used by the empirical cumulative distribution function (CDF).doublesample()Returns a sample from the empirical cumulative distribution function (CDF).double[]sample(int i) Returns a sample from the empirical cumulative distribution function (CDF).
- 
Constructor Details- 
EmpiricalCdfConstructor for EmpiricalCdf. - Parameters:
- data- a- Listobject
 
 
- 
- 
Method Details- 
cumulativeProbabilitypublic double cumulativeProbability(double x) Calculates the cumulative probability of a given point.- Specified by:
- cumulativeProbabilityin interface- org.apache.commons.math3.distribution.RealDistribution
- Parameters:
- x- the point at which the cumulative probability is evaluated
- Returns:
- the cumulative probability at the given point
 
- 
probabilitypublic double probability(double v) Calculates the probability mass function (PMF) of a given point.- Specified by:
- probabilityin interface- org.apache.commons.math3.distribution.RealDistribution
- Parameters:
- v- the point at which the PMF is evaluated
- Returns:
- the probability mass function at the given point
 
- 
densitypublic double density(double v) Calculates the probability density function (PDF) of a given point.- Specified by:
- densityin interface- org.apache.commons.math3.distribution.RealDistribution
- Parameters:
- v- the point at which the PDF is evaluated
- Returns:
- the probability density function at the given point
 
- 
cumulativeProbability@Deprecated public double cumulativeProbability(double v, double v1) throws org.apache.commons.math3.exception.NumberIsTooLargeException Deprecated.This method is deprecated and will be removed in a future release.Calculates the cumulative probability of a given point within the range [v, v1].- Specified by:
- cumulativeProbabilityin interface- org.apache.commons.math3.distribution.RealDistribution
- Parameters:
- v- the exclusive lower bound
- v1- the inclusive upper bound
- Returns:
- the cumulative probability of the given point within the range
- Throws:
- org.apache.commons.math3.exception.NumberIsTooLargeException- if v is greater than v1
 
- 
inverseCumulativeProbabilitypublic double inverseCumulativeProbability(double v) throws org.apache.commons.math3.exception.OutOfRangeException Calculates the inverse cumulative probability of a given point.- Specified by:
- inverseCumulativeProbabilityin interface- org.apache.commons.math3.distribution.RealDistribution
- Parameters:
- v- the cumulative probability
- Returns:
- the point at which the inverse cumulative probability is evaluated
- Throws:
- org.apache.commons.math3.exception.OutOfRangeException- if the cumulative probability is out of range
 
- 
getNumericalMeanpublic double getNumericalMean()Returns the numerical mean of the empirical cumulative distribution function (CDF). The numerical mean is calculated as the average of the data points.- Specified by:
- getNumericalMeanin interface- org.apache.commons.math3.distribution.RealDistribution
- Returns:
- the numerical mean of the CDF
 
- 
getNumericalVariancepublic double getNumericalVariance()Returns the numerical variance of the empirical cumulative distribution function (CDF). The numerical variance is calculated as the average of the squared differences between each data point and the numerical mean.- Specified by:
- getNumericalVariancein interface- org.apache.commons.math3.distribution.RealDistribution
- Returns:
- the numerical variance of the CDF
 
- 
getSupportLowerBoundpublic double getSupportLowerBound()Returns the lower bound of the support for the distribution. The support is the range of values for which the distribution is defined.- Specified by:
- getSupportLowerBoundin interface- org.apache.commons.math3.distribution.RealDistribution
- Returns:
- the lower bound of the support
 
- 
getSupportUpperBoundpublic double getSupportUpperBound()Returns the upper bound of the support for the distribution. The support is the range of values for which the distribution is defined.- Specified by:
- getSupportUpperBoundin interface- org.apache.commons.math3.distribution.RealDistribution
- Returns:
- the upper bound of the support
 
- 
isSupportLowerBoundInclusiveDeprecated.This method is deprecated and will be removed in a future release.Returns a boolean indicating whether the lower bound of the support is inclusive or not.- Specified by:
- isSupportLowerBoundInclusivein interface- org.apache.commons.math3.distribution.RealDistribution
- Returns:
- true if the lower bound is inclusive, false otherwise
 
- 
isSupportUpperBoundInclusiveDeprecated.This method is deprecated and will be removed in a future release.Returns a boolean indicating whether the upper bound of the support is inclusive or not.- Specified by:
- isSupportUpperBoundInclusivein interface- org.apache.commons.math3.distribution.RealDistribution
- Returns:
- true if the upper bound is inclusive, false otherwise
 
- 
isSupportConnectedpublic boolean isSupportConnected()Returns a boolean indicating whether the support of the distribution is connected or not.- Specified by:
- isSupportConnectedin interface- org.apache.commons.math3.distribution.RealDistribution
- Returns:
- true if the support is connected, false otherwise
 
- 
reseedRandomGeneratorpublic void reseedRandomGenerator(long l) Reseeds the random number generator used by the empirical cumulative distribution function (CDF).- Specified by:
- reseedRandomGeneratorin interface- org.apache.commons.math3.distribution.RealDistribution
- Parameters:
- l- the new seed value for the random number generator
 
- 
samplepublic double sample()Returns a sample from the empirical cumulative distribution function (CDF).- Specified by:
- samplein interface- org.apache.commons.math3.distribution.RealDistribution
- Returns:
- a sample from the CDF
 
- 
samplepublic double[] sample(int i) Returns a sample from the empirical cumulative distribution function (CDF).- Specified by:
- samplein interface- org.apache.commons.math3.distribution.RealDistribution
- Parameters:
- i- the number of random values to generate
- Returns:
- an array of random values sampled from the CDF
 
 
-