www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
WeibullDistribution Class Reference

A class used to generate a three-parameter Weibull distribution. More...

#include <WeibullDistribution.h>

Inheritance diagram for WeibullDistribution:
[legend]

Public Member Functions

 WeibullDistribution (const InputParameters &parameters)
 
virtual Real pdf (const Real &x) const override
 
virtual Real cdf (const Real &x) const override
 
virtual Real quantile (const Real &p) const override
 
Real pdf (const Real &x, const Real &location, const Real &scale, const Real &shape) const
 
Real cdf (const Real &x, const Real &location, const Real &scale, const Real &shape) const
 
Real quantile (const Real &p, const Real &location, const Real &scale, const Real &shape) const
 

Protected Attributes

const Real & _a
 The location parameter (a or low) More...
 
const Real & _b
 The scale parameter (b or lambda) More...
 
const Real & _c
 The shape parameter (c or k) More...
 

Detailed Description

A class used to generate a three-parameter Weibull distribution.

Definition at line 23 of file WeibullDistribution.h.

Constructor & Destructor Documentation

◆ WeibullDistribution()

WeibullDistribution::WeibullDistribution ( const InputParameters &  parameters)

Definition at line 28 of file WeibullDistribution.C.

29  : Distribution(parameters),
30  _a(getParam<Real>("location")),
31  _b(getParam<Real>("scale")),
32  _c(getParam<Real>("shape"))
33 {
34 }
const Real & _c
The shape parameter (c or k)
const Real & _a
The location parameter (a or low)
const Real & _b
The scale parameter (b or lambda)

Member Function Documentation

◆ cdf() [1/2]

Real WeibullDistribution::cdf ( const Real &  x) const
overridevirtual

Definition at line 82 of file WeibullDistribution.C.

83 {
84  return cdf(x, _a, _b, _c);
85 }
const Real & _c
The shape parameter (c or k)
const Real & _a
The location parameter (a or low)
virtual Real cdf(const Real &x) const override
const Real & _b
The scale parameter (b or lambda)

◆ cdf() [2/2]

Real WeibullDistribution::cdf ( const Real &  x,
const Real &  location,
const Real &  scale,
const Real &  shape 
) const

Definition at line 52 of file WeibullDistribution.C.

56 {
57  if (x <= location)
58  return 0.0;
59  else
60  {
61  const Real y = (x - location) / scale;
62  return 1.0 - std::exp(-std::pow(y, shape));
63  }
64 }
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ pdf() [1/2]

Real WeibullDistribution::pdf ( const Real &  x) const
overridevirtual

Definition at line 76 of file WeibullDistribution.C.

77 {
78  return pdf(x, _a, _b, _c);
79 }
const Real & _c
The shape parameter (c or k)
virtual Real pdf(const Real &x) const override
const Real & _a
The location parameter (a or low)
const Real & _b
The scale parameter (b or lambda)

◆ pdf() [2/2]

Real WeibullDistribution::pdf ( const Real &  x,
const Real &  location,
const Real &  scale,
const Real &  shape 
) const

Definition at line 37 of file WeibullDistribution.C.

41 {
42  if (x <= location)
43  return 0.0;
44  else
45  {
46  const Real y = (x - location) / scale;
47  return shape / scale * std::pow(y, shape - 1.0) * std::exp(-std::pow(y, shape));
48  }
49 }
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

◆ quantile() [1/2]

Real WeibullDistribution::quantile ( const Real &  p) const
overridevirtual

Definition at line 88 of file WeibullDistribution.C.

89 {
90  return quantile(p, _a, _b, _c);
91 }
virtual Real quantile(const Real &p) const override
const Real & _c
The shape parameter (c or k)
const Real & _a
The location parameter (a or low)
const Real & _b
The scale parameter (b or lambda)

◆ quantile() [2/2]

Real WeibullDistribution::quantile ( const Real &  p,
const Real &  location,
const Real &  scale,
const Real &  shape 
) const

Definition at line 67 of file WeibullDistribution.C.

71 {
72  return location + scale * std::pow(-std::log(1 - p), 1.0 / shape);
73 }
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)

Member Data Documentation

◆ _a

const Real& WeibullDistribution::_a
protected

The location parameter (a or low)

Definition at line 39 of file WeibullDistribution.h.

Referenced by cdf(), pdf(), and quantile().

◆ _b

const Real& WeibullDistribution::_b
protected

The scale parameter (b or lambda)

Definition at line 42 of file WeibullDistribution.h.

Referenced by cdf(), pdf(), and quantile().

◆ _c

const Real& WeibullDistribution::_c
protected

The shape parameter (c or k)

Definition at line 45 of file WeibullDistribution.h.

Referenced by cdf(), pdf(), and quantile().


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