1 [section:weibull_dist Weibull Distribution]
3 ``#include <boost/math/distributions/weibull.hpp>``
5 namespace boost{ namespace math{
7 template <class RealType = double,
8 class ``__Policy`` = ``__policy_class`` >
9 class weibull_distribution;
11 typedef weibull_distribution<> weibull;
13 template <class RealType, class ``__Policy``>
14 class weibull_distribution
17 typedef RealType value_type;
18 typedef Policy policy_type;
20 weibull_distribution(RealType shape, RealType scale = 1)
22 RealType shape()const;
23 RealType scale()const;
28 The [@http://en.wikipedia.org/wiki/Weibull_distribution Weibull distribution]
29 is a continuous distribution
31 [@http://en.wikipedia.org/wiki/Probability_density_function probability density function]:
33 [expression f(x; [alpha], [beta]) = ([alpha]\/[beta]) * (x \/ [beta])[super [alpha] - 1] * e[super -(x\/[beta])[super [alpha]]]]
35 For shape parameter ['[alpha]] > 0, and scale parameter ['[beta]] > 0, and /x/ > 0.
37 The Weibull distribution is often used in the field of failure analysis;
38 in particular it can mimic distributions where the failure rate varies over time.
39 If the failure rate is:
41 * constant over time, then ['[alpha]] = 1, suggests that items are failing from random events.
42 * decreases over time, then ['[alpha]] < 1, suggesting "infant mortality".
43 * increases over time, then ['[alpha]] > 1, suggesting "wear out" - more likely to fail as time goes by.
45 The following graph illustrates how the PDF varies with the shape parameter ['[alpha]]:
49 While this graph illustrates how the PDF varies with the scale parameter ['[beta]]:
53 [h4 Related distributions]
55 When ['[alpha]] = 3, the
56 [@http://en.wikipedia.org/wiki/Weibull_distribution Weibull distribution] appears similar to the
57 [@http://en.wikipedia.org/wiki/Normal_distribution normal distribution].
58 When ['[alpha]] = 1, the Weibull distribution reduces to the
59 [@http://en.wikipedia.org/wiki/Exponential_distribution exponential distribution].
60 The relationship of the types of extreme value distributions, of which the Weibull is but one, is
62 [@http://www.worldscibooks.com/mathematics/p191.html Extreme Value Distributions, Theory and Applications
63 Samuel Kotz & Saralees Nadarajah].
68 weibull_distribution(RealType shape, RealType scale = 1);
70 Constructs a [@http://en.wikipedia.org/wiki/Weibull_distribution
71 Weibull distribution] with shape /shape/ and scale /scale/.
73 Requires that the /shape/ and /scale/ parameters are both greater than zero,
74 otherwise calls __domain_error.
76 RealType shape()const;
78 Returns the /shape/ parameter of this distribution.
80 RealType scale()const;
82 Returns the /scale/ parameter of this distribution.
84 [h4 Non-member Accessors]
86 All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] that are generic to all
87 distributions are supported: __usual_accessors.
89 The domain of the random variable is \[0, [infin]\].
93 The Weibull distribution is implemented in terms of the
94 standard library `log` and `exp` functions plus __expm1 and __log1p
95 and as such should have very low error rates.
100 In the following table ['[alpha]] is the shape parameter of the distribution,
101 ['[beta]] is its scale parameter, /x/ is the random variate, /p/ is the probability
105 [[Function][Implementation Notes]]
106 [[pdf][Using the relation: pdf = [alpha][beta][super -[alpha] ]x[super [alpha] - 1] e[super -(x/beta)[super alpha]] ]]
107 [[cdf][Using the relation: p = -__expm1(-(x\/[beta])[super [alpha]]) ]]
108 [[cdf complement][Using the relation: q = e[super -(x\/[beta])[super [alpha]]] ]]
109 [[quantile][Using the relation: x = [beta] * (-__log1p(-p))[super 1\/[alpha]] ]]
110 [[quantile from the complement][Using the relation: x = [beta] * (-log(q))[super 1\/[alpha]] ]]
111 [[mean][[beta] * [Gamma](1 + 1\/[alpha]) ]]
112 [[variance][[beta][super 2]([Gamma](1 + 2\/[alpha]) - [Gamma][super 2](1 + 1\/[alpha])) ]]
113 [[mode][[beta](([alpha] - 1) \/ [alpha])[super 1\/[alpha]] ]]
114 [[skewness][Refer to [@http://mathworld.wolfram.com/WeibullDistribution.html Weisstein, Eric W. "Weibull Distribution." From MathWorld--A Wolfram Web Resource.] ]]
115 [[kurtosis][Refer to [@http://mathworld.wolfram.com/WeibullDistribution.html Weisstein, Eric W. "Weibull Distribution." From MathWorld--A Wolfram Web Resource.] ]]
116 [[kurtosis excess][Refer to [@http://mathworld.wolfram.com/WeibullDistribution.html Weisstein, Eric W. "Weibull Distribution." From MathWorld--A Wolfram Web Resource.] ]]
120 * [@http://en.wikipedia.org/wiki/Weibull_distribution ]
121 * [@http://mathworld.wolfram.com/WeibullDistribution.html Weisstein, Eric W. "Weibull Distribution." From MathWorld--A Wolfram Web Resource.]
122 * [@http://www.itl.nist.gov/div898/handbook/eda/section3/eda3668.htm Weibull in NIST Exploratory Data Analysis]
124 [endsect] [/section:weibull Weibull]
127 Copyright 2006 John Maddock and Paul A. Bristow.
128 Distributed under the Boost Software License, Version 1.0.
129 (See accompanying file LICENSE_1_0.txt or copy at
130 http://www.boost.org/LICENSE_1_0.txt).