org.jscience.mathematics.statistics
Class WeibullDistribution

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

public class WeibullDistribution
extends Distribution
implements java.io.Serializable

This class models the Weibull distribution with specified shape and scale parameters.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jscience.mathematics.statistics.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
WeibullDistribution()
          This default constructor creates a new Weibull distribution with shape parameter 1 and scale parameter 1.
WeibullDistribution(double k, double b)
          This general constructor creates a new Weibull distribution with spcified shape and scale parameters.
 
Method Summary
 double getCDF(double x)
          This method computes the cumulative distribution function.
 double getDensity(double x)
          This method computes the denstiy function.
 double getFailureRate(double x)
          This method computes the failure rate function.
 double getMaxDensity()
          This method returns the maximum value of the density function.
 double getMean()
          The method returns the mean of the distribution.
 double getMoment(double a, int n)
          This method returns the moment of a specified order about a specified point.
 double getMoment(int n)
          This method returns the moment of a specified order.
 double getQuantile(double p)
          This method returns the quantile function
 double getScale()
          This method returns the scale parameter.
 double getShape()
          This method returns the shape parameter.
 double getVariance()
          This method returns the variance of the distribution.
 void setParameters(double k, double b)
          This method sets the shape and scale parameter.
 void setScale(double b)
          This method sets the scale parameter.
 void setShape(double k)
          This method sets the shape 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, getMedian, getMGF, 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

WeibullDistribution

public WeibullDistribution(double k,
                           double b)
This general constructor creates a new Weibull distribution with spcified shape and scale parameters.

Parameters:
k - the shape parameter
b - the scale parameter

WeibullDistribution

public WeibullDistribution()
This default constructor creates a new Weibull distribution with shape parameter 1 and scale parameter 1.

Method Detail

setParameters

public void setParameters(double k,
                          double b)
This method sets the shape and scale parameter. The normalizing constant is computed and the default domain defined.

Parameters:
k - the shape parameter
b - the scale parameter

getDensity

public double getDensity(double x)
This method computes the denstiy 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 returns 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()
The method returns the mean of the distribution.

Overrides:
getMean in class Distribution
Returns:
the mean

getVariance

public double getVariance()
This method returns the variance of the distribution.

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 that order

getMoment

public double getMoment(double a,
                        int n)
This method returns the moment of 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 distsribution at x.

getQuantile

public double getQuantile(double p)
This method returns the quantile function

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

getFailureRate

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

Overrides:
getFailureRate in class Distribution
Parameters:
x - a number in the domain of the distribution
Returns:
the failure rate at x

getShape

public double getShape()
This method returns the shape parameter.

Returns:
the shape parameter

setShape

public void setShape(double k)
This method sets the shape parameter.

Parameters:
k - the shape parameter

getScale

public double getScale()
This method returns the scale parameter.

Returns:
the scale parameter

setScale

public void setScale(double b)
This method sets the scale parameter.

Parameters:
b - the scale parameter

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