STK++ 0.9.13

Weibull distribution law. More...

#include <STK_Law_Weibull.h>

Inheritance diagram for STK::Law::Weibull:
Inheritance graph

Public Types

typedef IUnivLaw< RealBase
 

Public Member Functions

 Weibull (Real const &k=1., Real const &lambda=1.)
 Default constructor.
 
virtual ~Weibull ()
 destructor
 
Real constk () const
 
Real constlambda () const
 
void setK (Real const &k)
 
void setLambda (Real const &lambda)
 
virtual Real rand () const
 
virtual Real pdf (Real const &x) const
 
virtual Real lpdf (Real const &x) const
 
virtual Real cdf (Real const &t) const
 The cumulative distribution function for the Weibull distribution is $ F(x;k,\lambda) = 1- e^{-(x/\lambda)^k}.$.
 
virtual Real icdf (Real const &p) const
 The quantile (inverse cumulative distribution) function for the Weibull distribution is $ Q(p;k,\lambda) = \lambda {(-\ln(1-p))}^{1/k} $.
 
- Public Member Functions inherited from STK::Law::IUnivLaw< Real >
virtual ~IUnivLaw ()
 Virtual destructor.
 
virtual Real lcdf (Real const &t) const
 compute the lower tail log-cumulative distribution function Give the log-probability that a random variate is less or equal to t.
 
virtual Real cdfc (Real const &t) const
 calculate the complement of cumulative distribution function, called in statistics the survival function.
 
virtual Real lcdfc (Real const &t) const
 calculate the log-complement of cumulative distribution function Give the log-probability that a random variate is greater than t.
 
- Public Member Functions inherited from STK::Law::ILawBase
String constname () const
 

Static Public Member Functions

static Real rand (Real const &k, Real const &lambda)
 
static Real pdf (Real const &x, Real const &k, Real const &lambda)
 
static Real lpdf (Real const &x, Real const &k, Real const &lambda)
 
static Real cdf (Real const &t, Real const &k, Real const &lambda)
 
static Real icdf (Real const &p, Real const &k, Real const &lambda)
 Compute the inverse cumulative distribution function at p of the standard log-normal distribution.
 

Protected Attributes

Real k_
 The shape parameter.
 
Real lambda_
 The scale parameter.
 
- Protected Attributes inherited from STK::Law::ILawBase
String name_
 Name of the Law.
 

Additional Inherited Members

- Protected Member Functions inherited from STK::Law::IUnivLaw< Real >
 IUnivLaw (String const &name)
 Constructor.
 
 IUnivLaw (IUnivLaw const &law)
 copy Constructor.
 
- Protected Member Functions inherited from STK::Law::ILawBase
 ILawBase (String const &name)
 Constructor.
 
 ~ILawBase ()
 destructor.
 

Detailed Description

Weibull distribution law.

In probability theory and statistics, the Weibull distribution is a continuous probability distribution. It is named after Waloddi Weibull, who described it in detail in 1951.

The probability density function of a Weibull random variable is

\[
 f(x;\lambda,k) =
 \frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1}e^{-(x/\lambda)^{k}} \quad x\geq0 ,
 \]

where k > 0 is the shape parameter and $ λ > 0$ is the scale parameter of the distribution.

Definition at line 60 of file STK_Law_Weibull.h.

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ Weibull()

STK::Law::Weibull::Weibull ( Real const k = 1.,
Real const lambda = 1. 
)
inline

Default constructor.

Parameters
k,lambdashape and scale (dispersion) parameters

Definition at line 67 of file STK_Law_Weibull.h.

68 : Base(_T("Weibull")), k_(k), lambda_(lambda)
69 {}
#define _T(x)
Let x unmodified.
IUnivLaw< Real > Base
Real const & k() const
Real lambda_
The scale parameter.
Real const & lambda() const
Real k_
The shape parameter.

◆ ~Weibull()

virtual STK::Law::Weibull::~Weibull ( )
inlinevirtual

destructor

Definition at line 71 of file STK_Law_Weibull.h.

71{}

Member Function Documentation

◆ cdf() [1/2]

Real STK::Law::Weibull::cdf ( Real const t) const
virtual

The cumulative distribution function for the Weibull distribution is $ F(x;k,\lambda) = 1- e^{-(x/\lambda)^k}.$.

Returns
the cumulative distribution function
Parameters
ta positive real value

Implements STK::Law::IUnivLaw< Real >.

Definition at line 71 of file STK_Law_Weibull.cpp.

72{
73 return 0;
74}

◆ cdf() [2/2]

Real STK::Law::Weibull::cdf ( Real const t,
Real const k,
Real const lambda 
)
static
Returns
the cumulative distribution function
Parameters
ta positive real value
k,lambdashape and scale (dispersion) parameters

Definition at line 112 of file STK_Law_Weibull.cpp.

113{
114 return 0;
115}

◆ icdf() [1/2]

Real STK::Law::Weibull::icdf ( Real const p) const
virtual

The quantile (inverse cumulative distribution) function for the Weibull distribution is $ Q(p;k,\lambda) = \lambda {(-\ln(1-p))}^{1/k} $.

Returns
the inverse cumulative distribution function
Parameters
pa probability number

Implements STK::Law::IUnivLaw< Real >.

Definition at line 80 of file STK_Law_Weibull.cpp.

81{
82 return 0;
83}

◆ icdf() [2/2]

Real STK::Law::Weibull::icdf ( Real const p,
Real const k,
Real const lambda 
)
static

Compute the inverse cumulative distribution function at p of the standard log-normal distribution.

Parameters
pa probability number.
k,lambdashape and scale (dispersion) parameters
Returns
the inverse cumulative distribution function value at p.

Definition at line 123 of file STK_Law_Weibull.cpp.

124{
125 return 0;
126}

◆ k()

Real const & STK::Law::Weibull::k ( ) const
inline
Returns
shape parameter

Definition at line 73 of file STK_Law_Weibull.h.

73{ return k_;}

References k_.

Referenced by setK().

◆ lambda()

Real const & STK::Law::Weibull::lambda ( ) const
inline
Returns
scale parameter

Definition at line 75 of file STK_Law_Weibull.h.

75{ return lambda_;}

References lambda_.

Referenced by setLambda().

◆ lpdf() [1/2]

Real STK::Law::Weibull::lpdf ( Real const x) const
virtual
Returns
the value of the log-pdf
Parameters
xa positive real value

Reimplemented from STK::Law::IUnivLaw< Real >.

Definition at line 62 of file STK_Law_Weibull.cpp.

63{
64 return 0;
65}

◆ lpdf() [2/2]

Real STK::Law::Weibull::lpdf ( Real const x,
Real const k,
Real const lambda 
)
static
Returns
the value of the log-pdf
Parameters
xa positive real value
k,lambdashape and scale (dispersion) parameters

Definition at line 104 of file STK_Law_Weibull.cpp.

105{
106 return 0;
107}

◆ pdf() [1/2]

Real STK::Law::Weibull::pdf ( Real const x) const
virtual
Returns
the value of the pdf
Parameters
xa positive real value

Implements STK::Law::IUnivLaw< Real >.

Definition at line 55 of file STK_Law_Weibull.cpp.

56{
57 return 0;
58}

◆ pdf() [2/2]

Real STK::Law::Weibull::pdf ( Real const x,
Real const k,
Real const lambda 
)
static
Returns
the value of the pdf
Parameters
xa positive real value
k,lambdashape and scale (dispersion) parameters

Definition at line 96 of file STK_Law_Weibull.cpp.

97{
98 return 0;
99}

◆ rand() [1/2]

Real STK::Law::Weibull::rand ( ) const
virtual
Returns
a pseudo Weibull random variate.

Implements STK::Law::IUnivLaw< Real >.

Definition at line 48 of file STK_Law_Weibull.cpp.

49{
50 return 0;
51}

◆ rand() [2/2]

Real STK::Law::Weibull::rand ( Real const k,
Real const lambda 
)
static
Returns
a pseudo Weibull random variate with the specified parameters.
Parameters
k,lambdashape and scale (dispersion) parameters

Definition at line 88 of file STK_Law_Weibull.cpp.

89{
90 return 0;
91}

◆ setK()

void STK::Law::Weibull::setK ( Real const k)
inline
Parameters
kset the shape parameter

Definition at line 77 of file STK_Law_Weibull.h.

78 {
79 if (k<=0) STKDOMAIN_ERROR_1ARG(Weibull::setShape,k,shape must be > 0);
80 k_ = k;
81 }
#define STKDOMAIN_ERROR_1ARG(Where, Arg, Error)
Definition STK_Macros.h:165

References k(), k_, and STKDOMAIN_ERROR_1ARG.

◆ setLambda()

void STK::Law::Weibull::setLambda ( Real const lambda)
inline
Parameters
lambdaset the scale parameter

Definition at line 83 of file STK_Law_Weibull.h.

84 {
85 if (lambda<=0) STKDOMAIN_ERROR_1ARG(Weibull::setScale,lambda,scale must be > 0);
87 }

References lambda(), lambda_, and STKDOMAIN_ERROR_1ARG.

Member Data Documentation

◆ k_

Real STK::Law::Weibull::k_
protected

The shape parameter.

Definition at line 149 of file STK_Law_Weibull.h.

Referenced by k(), and setK().

◆ lambda_

Real STK::Law::Weibull::lambda_
protected

The scale parameter.

Definition at line 151 of file STK_Law_Weibull.h.

Referenced by lambda(), and setLambda().


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