#include <Weibull.h>
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 ![]() | |
double | beta () const |
Returns the current value of the distribution's parameter ![]() | |
void | alpha (double a) |
Sets the distribution's parameter ![]() | |
void | beta (double b) |
Sets the distribution's parameter ![]() | |
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 ![]() ![]() | |
double | p (const double &) const |
Returns the probability for the occurrence of random number "x" for the Weibull distribution with the parameter values ![]() ![]() | |
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 ![]() ![]() | |
Protected Attributes | |
double | pAlpha |
The distribution's parameter ![]() | |
double | pBeta |
The distribution's parameter ![]() |
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
with .
Below you can see the distribution for the parameter values ,
and
:
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 as stored in pAlpha and
as stored in pBeta are initialized.
For this instance, the default pseudo random number generator as member of class RandomVar is used.
alpha | the parameter ![]() | |
beta | the parameter ![]() |
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 as stored in pAlpha and
as stored in pBeta are initialized.
alpha | the parameter ![]() | |
beta | the parameter ![]() | |
r | the pseudo random number generator that is used |
double Weibull::alpha | ( | ) | const [inline] |
Returns the current value of the distribution's parameter .
double Weibull::beta | ( | ) | const [inline] |
Returns the current value of the distribution's parameter .
void Weibull::alpha | ( | double | a | ) | [inline] |
Sets the distribution's parameter to the new value "a".
a | the new value for parameter ![]() |
void Weibull::beta | ( | double | b | ) | [inline] |
Sets the distribution's parameter to the new value "b".
b | the new value for parameter ![]() |
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.
alpha | the distribution's parameter ![]() | |
beta | the distribution's parameter ![]() |
double Weibull::operator() | ( | ) | [virtual] |
For the current distribution parameters and
, this method returns a Weibull random number.
For the current distribution parameters and
, this method returns a Weibull random number.
For the current distribution's parameters as stored in pAlpha and
as stored in pBeta a Weibull random number is returned.
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 as stored in pAlpha and
as stored in pBeta.
Returns the probability for the occurrence of random number "x" for the Weibull distribution with the parameter values as stored in pAlpha and
as stored in pBeta.
x | the random number for which the occurrence probability will be returned. If ![]() |
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 and "b" for parameter
.
Returns the probability for the occurrence of random number "x" for the Weibull distribution with the values "a" for parameter and "b" for parameter
.
a | the value for the distribution's parameter ![]() | |
b | the value for the distribution's parameter ![]() | |
x | the random number for which the occurrence probability will be returned. If ![]() |