org.jscience.mathematics.statistics
Class ContinuousUniformDistribution

java.lang.Object
  extended by org.jscience.mathematics.statistics.Distribution
      extended by org.jscience.mathematics.statistics.ContinuousUniformDistribution
All Implemented Interfaces:
java.io.Serializable

public class ContinuousUniformDistribution
extends Distribution
implements java.io.Serializable

This class models the uniform distribution on a specified interval.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jscience.mathematics.statistics.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
ContinuousUniformDistribution()
          This default constructor creates a new uniform distribuiton on (0, 1).
ContinuousUniformDistribution(double a, double b)
          This general constructor creates a new uniform distribution on a specified interval.
 
Method Summary
 double getCDF(double x)
          This method computes the cumulative distribution function in terms of the parameters.
 double getDensity(double x)
          This method computes the probability density function.
 double getLowerBound()
          This method gets the lower bound of the domain of the distribution.
 double getMaxDensity()
          This method computes the maximum value of the density function, which is any value, since the density function is constant.
 double getMean()
          This method computes the mean of the distribution in terms of the parameters.
 double getMGF(double t)
          This method computes the moment generating function in terms of the parameters.
 double getMoment(double a, int n)
          ' This method computes the moment of a specified order about a specified point, in terms of the parameters.
 double getQuantile(double p)
          This method computes the quantile function in terms of the parameters.
 double getUpperBound()
          This method returns the upper bound of the domain.
 double getVariance()
          This method computes the variance of the distribution in terms of the parameters.
 void setLowerBound(double a)
          This method sets the lower bound of the domain.
 void setParameters(double a, double b)
          This method sets the parameters: the minimum and maximum values of the interval.
 void setUpperBound(double b)
          This method sets the upper bound of the domain.
 java.lang.String toString()
          This method returns a string that gives the name of the distribution and the values of the parameters.
 
Methods inherited from class org.jscience.mathematics.statistics.Distribution
getDomain, getFailureRate, getMedian, getMoment, getPGF, getSD, getType, setDomain, setDomain, simulate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContinuousUniformDistribution

public ContinuousUniformDistribution(double a,
                                     double b)
This general constructor creates a new uniform distribution on a specified interval.

Parameters:
a - the left endpoint
b - the right endpoint

ContinuousUniformDistribution

public ContinuousUniformDistribution()
This default constructor creates a new uniform distribuiton on (0, 1).

Method Detail

setParameters

public void setParameters(double a,
                          double b)
This method sets the parameters: the minimum and maximum values of the interval. The default domain is sepcified.

Parameters:
a - the left enpdoint
b - the right endpoint

getDensity

public double getDensity(double x)
This method computes the probability density function.

Specified by:
getDensity in class Distribution
Parameters:
x - a number in the domain of the distribution
Returns:
the probability density at x

getMaxDensity

public double getMaxDensity()
This method computes the maximum value of the density function, which is any value, since the density function is constant.

Overrides:
getMaxDensity in class Distribution
Returns:
the maximum value of the density function

getMean

public double getMean()
This method computes the mean of the distribution in terms of the parameters.

Overrides:
getMean in class Distribution
Returns:
the mean

getVariance

public double getVariance()
This method computes the variance of the distribution in terms of the parameters.

Overrides:
getVariance in class Distribution
Returns:
the variance

getMoment

public double getMoment(double a,
                        int n)
' This method computes the moment of a specified order about a specified point, in terms of the parameters.

Overrides:
getMoment in class Distribution
Parameters:
a - the center
n - the order
Returns:
the moment of order n about a

getMGF

public double getMGF(double t)
This method computes the moment generating function in terms of the parameters.

Overrides:
getMGF in class Distribution
Parameters:
t - a real number
Returns:
the moment generating function at t

getCDF

public double getCDF(double x)
This method computes the cumulative distribution function in terms of the parameters.

Overrides:
getCDF in class Distribution
Parameters:
x - a number in the domain of the distribution
Returns:
the cumulative probability at x

getQuantile

public double getQuantile(double p)
This method computes the quantile function in terms of the parameters.

Overrides:
getQuantile in class Distribution
Parameters:
p - a probability in (0, 1)
Returns:
the quantile of order p

setLowerBound

public void setLowerBound(double a)
This method sets the lower bound of the domain.

Parameters:
a - the lower bound

getLowerBound

public double getLowerBound()
This method gets the lower bound of the domain of the distribution.

Returns:
the left endpoint of the interval

setUpperBound

public void setUpperBound(double b)
This method sets the upper bound of the domain.

Parameters:
b - the upper bound

getUpperBound

public double getUpperBound()
This method returns the upper bound of the domain.

Returns:
the right enpoint of the interval

toString

public java.lang.String toString()
This method returns a string that gives the name of the distribution and the values of the parameters.

Overrides:
toString in class Distribution
Returns:
a string giving the name of the distribution and the values of the parameters