Weibull Class Reference

This class simulates a "%Weibull distribution". More...

#include <Weibull.h>

Inheritance diagram for Weibull:

RandomVar< double >

List of all members.

Public Member Functions

 Weibull (double alpha=1, double beta=1)
 Creates a new instance of the Weibull random number generator and initializes the distribution's parameters.
 Weibull (double alpha, double beta, RNG &r)
 Creates a new Weibull random generator instance by using the pseudo random number generator "r" for the determination of random values and initializes the distribution's parameters.
double alpha () const
 Returns the current value of the distribution's parameter $\alpha$.
double beta () const
 Returns the current value of the distribution's parameter $\beta$.
void alpha (double a)
 Sets the distribution's parameter $\alpha$ to the new value "a".
void beta (double b)
 Sets the distribution's parameter $\beta$ to the new value "b".
double operator() (double alpha, double beta)
 For the given distribution parameters "alpha" and "beta" this method returns a Weibull random number.
double operator() ()
 For the current distribution parameters $\alpha$ and $\beta$, this method returns a Weibull random number.
double p (const double &) const
 Returns the probability for the occurrence of random number "x" for the Weibull distribution with the parameter values $\alpha$ as stored in pAlpha and $\beta$ as stored in pBeta.
double p (const double &, const double &, const double &) const
 Returns the probability for the occurrence of random number "x" for the Weibull distribution with the values "a" for parameter $\alpha$ and "b" for parameter $\beta$.

Protected Attributes

double pAlpha
 The distribution's parameter $\alpha$ (see class description).
double pBeta
 The distribution's parameter $\beta$ (see class description).


Detailed Description

This class simulates a "%Weibull distribution".

This class is derived from class RandomVar and the uniformally distributed pseudo random number values of the interval (0,1) are transformed to type "double" of the Weibull distribution.
The Weibull distribution is an enhancement of the (Negative) Exponential distribution to events that are not purely random and that can be not modelled exactly by the Poisson distribution.
The Weibull distribution is the classic reliability analysis and lifetime diagram. It is heavily used by the automobile and wind industry.
The distribution is given by

$ f(x) = \frac{\alpha}{\beta} \cdot e^{-\frac{1}{\beta} \cdot x^\alpha} \cdot x^{\alpha - 1} $

with $x > 0$.
Below you can see the distribution for the parameter values $\alpha = 1\mbox{,\ } \beta = 2$, $\alpha = 2\mbox{,\ } \beta = 1$ and $\alpha = 2\mbox{,\ } \beta = 3$:

weibull.png

Author:
M. Kreutz
Date:
1995-01-01
Changes:
none
Status:
stable

Constructor & Destructor Documentation

Weibull::Weibull ( double  alpha = 1,
double  beta = 1 
)

Creates a new instance of the Weibull random number generator and initializes the distribution's parameters.

Creates a new instance of the Weibull random number generator and initializes the distribution's parameters.

The distribution's parameter $\alpha$ as stored in pAlpha and $\beta$ as stored in pBeta are initialized.
For this instance, the default pseudo random number generator as member of class RandomVar is used.

Parameters:
alpha the parameter $\alpha$ of the distribution, the default value is "1"
beta the parameter $\beta$ of the distribution, the default value is "1"
Returns:
none
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Weibull::Weibull ( double  alpha,
double  beta,
RNG r 
)

Creates a new Weibull random generator instance by using the pseudo random number generator "r" for the determination of random values and initializes the distribution's parameters.

Creates a new Weibull random generator instance by using the pseudo random number generator "r" for the determination of random values and initializes the distribution's parameters.

Each instance of a Weibull random number generator is based on a generator, that is defined in class RNG and returns uniformally pseudo random numbers of the interval (0,1). By default, this is a global generator named RNG::globalRng and included as member in class RandomVar.
Here another pseudo random number generator r is used instead.
Additionally to defining the used pseudo random number generator, the distribution's parameters $alpha$ as stored in pAlpha and $\beta$ as stored in pBeta are initialized.

Parameters:
alpha the parameter $\alpha$ of the distribution
beta the parameter $\beta$ of the distribution
r the pseudo random number generator that is used
Returns:
none
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable


Member Function Documentation

double Weibull::alpha (  )  const [inline]

Returns the current value of the distribution's parameter $\alpha$.

Returns:
the current value of $\alpha$ as stored in pAlpha
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

double Weibull::beta (  )  const [inline]

Returns the current value of the distribution's parameter $\beta$.

Returns:
the current value of $\beta$ as stored in pBeta
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

void Weibull::alpha ( double  a  )  [inline]

Sets the distribution's parameter $\alpha$ to the new value "a".

Parameters:
a the new value for parameter $\alpha$ as stored in pAlpha
Returns:
none
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

void Weibull::beta ( double  b  )  [inline]

Sets the distribution's parameter $\beta$ to the new value "b".

Parameters:
b the new value for parameter $\beta$ as stored in pBeta
Returns:
none
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

double Weibull::operator() ( double  alpha,
double  beta 
) [inline]

For the given distribution parameters "alpha" and "beta" this method returns a Weibull random number.

This method performs the inverse transformation of the original uniformally distributed random numbers of the interval (0,1) created by the used pseudo random number generator to the type of the Weibull distribution.

Parameters:
alpha the distribution's parameter $\alpha$
beta the distribution's parameter $\beta$
Returns:
a Weibull random number
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

double Weibull::operator() (  )  [virtual]

For the current distribution parameters $\alpha$ and $\beta$, this method returns a Weibull random number.

For the current distribution parameters $\alpha$ and $\beta$, this method returns a Weibull random number.

For the current distribution's parameters $\alpha$ as stored in pAlpha and $\beta$ as stored in pBeta a Weibull random number is returned.

Returns:
a Weibull random number
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Implements RandomVar< double >.

double Weibull::p ( const double &  x  )  const [virtual]

Returns the probability for the occurrence of random number "x" for the Weibull distribution with the parameter values $\alpha$ as stored in pAlpha and $\beta$ as stored in pBeta.

Returns the probability for the occurrence of random number "x" for the Weibull distribution with the parameter values $\alpha$ as stored in pAlpha and $\beta$ as stored in pBeta.

Parameters:
x the random number for which the occurrence probability will be returned. If $x \leq 0$ then the method will exit with an error message
Returns:
the occurrence probability for random number x
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Implements RandomVar< double >.

double Weibull::p ( const double &  a,
const double &  b,
const double &  x 
) const

Returns the probability for the occurrence of random number "x" for the Weibull distribution with the values "a" for parameter $\alpha$ and "b" for parameter $\beta$.

Returns the probability for the occurrence of random number "x" for the Weibull distribution with the values "a" for parameter $\alpha$ and "b" for parameter $\beta$.

Parameters:
a the value for the distribution's parameter $\alpha$
b the value for the distribution's parameter $\beta$
x the random number for which the occurrence probability will be returned. If $x \leq 0$ then the method will exit with an error message
Returns:
the occurrence probability for random number x
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable


The documentation for this class was generated from the following files:

Generated on Thu Aug 28 18:34:54 2008 for Dolphin by  doxygen 1.5.6