edu.uah.math.distributions
Class Distribution

java.lang.Object
  |
  +--edu.uah.math.distributions.Distribution
Direct Known Subclasses:
ContinuousUniformDistribution, Convolution, NormalDistribution, PoissonDistribution

public abstract class Distribution
extends java.lang.Object

Distribution: An abstract implmentation of a real probability distribution


Field Summary
static int CONTINUOUS
           
static int DISCRETE
           
static int MIXED
           
 
Constructor Summary
Distribution()
           
 
Method Summary
static double betaCDF(double x, double a, double b)
          The method computes the beta CDF.
static double comb(double n, int k)
          This method computes the number of combinations of k objects chosen from a population of n objects
static double factorial(int k)
          This method computes k!
static double gamma(double x)
          This method computes the gamma function.
static double gammaCDF(double x, double a)
          This method computes the CDF of the gamma distribution with shape parameter a and scale parameter 1
 double getCDF(double x)
          This method returns a default approximate cumulative distribution function.
abstract  double getDensity(double x)
          The getDensity method is abstract and must be overridden for any specific distribuiton
 Domain getDomain()
          This method returns the domain of the distribution.
 double getFailureRate(double x)
          This method computes the failure rate function
 double getMaxDensity()
          This method returns the largest (finite) value of the getDensity function on the finite set of domain values.
 double getMean()
          This method returns a default approximate mean, based on the finite set of domain values.
 double getMedian()
          This method computes a default approximate median.
 double getQuantile(double p)
          This method computes an approximate getQuantile function.
 double getSD()
          This method returns the standard deviation, as the square root of the variance
 int getType()
          This method returns the type of the distribution (discrete or continuous)
 double getVariance()
          This method returns a default approximate variance.
static double logGamma(double x)
          This method computes the log of the gamma function.
static double perm(double n, int k)
          This method computes the number of permuatations of k objects chosen from a population of n objects.
 void setParameters(double a, double b, double w, int t)
          This method defines a partition of an interval that acts as a default domain for the distribution, for purposes of data collection and for default computations.
 double simulate()
          This method computes a default simulation of a value from the distribution, as a random getQuantile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISCRETE

public static final int DISCRETE
See Also:
Constant Field Values

CONTINUOUS

public static final int CONTINUOUS
See Also:
Constant Field Values

MIXED

public static final int MIXED
See Also:
Constant Field Values
Constructor Detail

Distribution

public Distribution()
Method Detail

getDensity

public abstract double getDensity(double x)
The getDensity method is abstract and must be overridden for any specific distribuiton


setParameters

public void setParameters(double a,
                          double b,
                          double w,
                          int t)
This method defines a partition of an interval that acts as a default domain for the distribution, for purposes of data collection and for default computations. For a discrete distribution, the specified parameters define the midpoints of the partition (these are typically the values on which the distribution is defined, although truncated if the true set of values is infinite). For a continuous distribution, the parameters define the boundary points of the interval on which the distribuiton is defined (truncated if the true interval is infinite)


getDomain

public Domain getDomain()
This method returns the domain of the distribution.


getType

public final int getType()
This method returns the type of the distribution (discrete or continuous)


getMaxDensity

public double getMaxDensity()
This method returns the largest (finite) value of the getDensity function on the finite set of domain values. This method should be overridden if the maximum value is known in closed form


getMean

public double getMean()
This method returns a default approximate mean, based on the finite set of domain values. This method should be overriden if the mean is known in closed form


getVariance

public double getVariance()
This method returns a default approximate variance. This method should be overriden if the variance is known in closed form


getSD

public double getSD()
This method returns the standard deviation, as the square root of the variance


getCDF

public double getCDF(double x)
This method returns a default approximate cumulative distribution function. This should be overriden if the CDF is known in closed form


getQuantile

public double getQuantile(double p)
This method computes an approximate getQuantile function. This should be overriden if the getQuantile function is known in closed form


simulate

public double simulate()
This method computes a default simulation of a value from the distribution, as a random getQuantile. This method should be overridden if a better method of simulation is known.


getMedian

public double getMedian()
This method computes a default approximate median. This method should be overriden when there is a closed form expression for the median.


getFailureRate

public double getFailureRate(double x)
This method computes the failure rate function


perm

public static double perm(double n,
                          int k)
This method computes the number of permuatations of k objects chosen from a population of n objects.


factorial

public static double factorial(int k)
This method computes k!, the number of permutations of k objects.


comb

public static double comb(double n,
                          int k)
This method computes the number of combinations of k objects chosen from a population of n objects


logGamma

public static double logGamma(double x)
This method computes the log of the gamma function.


gamma

public static double gamma(double x)
This method computes the gamma function.


gammaCDF

public static double gammaCDF(double x,
                              double a)
This method computes the CDF of the gamma distribution with shape parameter a and scale parameter 1


betaCDF

public static double betaCDF(double x,
                             double a,
                             double b)
The method computes the beta CDF.