org.jscience.mathematics.statistics
Class BetaDistribution

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

public class BetaDistribution
extends Distribution
implements java.io.Serializable

This class is models the beta distribution with specified left and right parameters.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jscience.mathematics.statistics.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
BetaDistribution()
          This default constructor creates a beta distribution with left and right parameters equal to 1.
BetaDistribution(double a, double b)
          This general constructor creates a beta distribution with specified left and right parameters.
 
Method Summary
 double getCDF(double x)
          This method computes the cumulative distribution function.
 double getDensity(double x)
          This method computes the probability density function.
 double getLeft()
          This method gets the left paramter.
 double getMaxDensity()
          This method computes the maximum value of the density function.
 double getMean()
          This method compute the mean in terms of the parameters.
 double getMoment(double a, int n)
          This method returns the moment a specified order about a specified point.
 double getMoment(int n)
          This method returns the moment of a specified order.
 double getRight()
          This method gets the right parameter.
 double getVariance()
          This method computes the variance in terms of the parameters.
 void setLeft(double a)
          This method sets the left parameter.
 void setParameters(double a, double b)
          This method sets the parameters, computes the normalizing constant c, and specifies the default domain.
 void setRight(double b)
          This method sets the right parameter.
 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, getMGF, getPGF, getQuantile, getSD, getType, setDomain, setDomain, simulate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BetaDistribution

public BetaDistribution(double a,
                        double b)
This general constructor creates a beta distribution with specified left and right parameters.

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

BetaDistribution

public BetaDistribution()
This default constructor creates a beta distribution with left and right parameters equal to 1. This is the uniform distribution on (0, 1).

Method Detail

setParameters

public void setParameters(double a,
                          double b)
This method sets the parameters, computes the normalizing constant c, and specifies the default domain.

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

setLeft

public void setLeft(double a)
This method sets the left parameter.

Parameters:
a - the left parameter

setRight

public void setRight(double b)
This method sets the right parameter.

Parameters:
b - the right parameter

getLeft

public double getLeft()
This method gets the left paramter.

Returns:
the left parameter

getRight

public double getRight()
This method gets the right parameter.

Returns:
the right parameter

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.

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

getMean

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

Overrides:
getMean in class Distribution
Returns:
the mean

getVariance

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

Overrides:
getVariance in class Distribution
Returns:
the variance

getMoment

public double getMoment(int n)
This method returns the moment of a specified order.

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

getMoment

public double getMoment(double a,
                        int n)
This method returns the moment a specified order about a specified point.

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

getCDF

public double getCDF(double x)
This method computes the cumulative distribution function.

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

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