![]() |
Home | Libraries | People | FAQ | More |
#include <boost/math/distributions/weibull.hpp>
namespace boost{ namespace math{ template <class RealType = double, class Policy = policies::policy<> > class weibull_distribution; typedef weibull_distribution<> weibull; template <class RealType, class Policy> class weibull_distribution { public: typedef RealType value_type; typedef Policy policy_type; // 構造: weibull_distribution(RealType shape, RealType scale = 1) // 訪問函數(Accessors): RealType shape()const; RealType scale()const; }; }} // namespaces
韋泊爾分佈(Weibull distribution) 是一個連續分佈,概率密度函數為(probability density function):
f(x; α, β) = (α/β) * (x / β)α - 1 * e-(x/β)α
對於形狀參數(shape parameter) α > 0,尺度參數(scale parameter) β > 0,且 x > 0。
韋泊爾分佈(Weibull distribution)通常用在故障分析領域( field of failure analysis)中;尤其是它可以模擬(mimic) 故障率(failture rate)持續( over time)變化的分佈。故障率為:
下面的圖像顯示了當形狀參數(shape parameter) α 發生變化時,函數PDF發生的變化:
下面這個圖像顯示當尺度參數(scale parameter) β 發生變化時,函數PDF的變化:
當α = 3時,韋泊爾分佈(Weibull distribution) 類似於正態分佈(normal distribution)。 當 α = 1時, 韋泊爾分佈(Weibull distribution)簡化為( reduces to) 指數分佈(exponential distribution)。 極值分佈(extreme value distribution)類型之間的關係,韋泊爾分佈僅是其中之一,由Extreme Value Distributions, Theory and Applications Samuel Kotz & Saralees Nadarajah進行討論。
weibull_distribution(RealType shape, RealType scale = 1);
使用形狀參數(shape parameter)shape 和尺度參數(scale parameter)scale來構造一個韋泊爾分佈(Weibull distribution) 。
要求shape 和 scale 參數都大於0,否則調用定義域錯誤。
RealType shape()const;
返回分佈的shape參數。
RealType scale()const;
返回分佈的scale 參數。
支持所有的分佈都通用的 常見的非成員訪問函數 : 累積分佈函數(Cumulative Distribution Function),概率密度函數(Probability Density Function),分位點(Quantile), 故障率函數(Hazard Function), 累積危險函數(Cumulative Hazard Function), 均值(mean), 中位數(median), 眾數(mode), 方差(variance), 標準差(standard deviation), 偏斜(skewness), 峰態(kurtosis), 峰態超越(kurtosis_excess), 值域(range) 以及 支持(support)。
隨機變量的定義域: [0, ∞]。
韋泊爾分佈(Weibull distribution)使用標準庫函數log
和 exp
加上 expm1
和log1p 實現,因此誤差率(error rate )將非常低。
下面的表中:α 是形狀參數(shape parameter),β 是尺度參數( scale parameter),x 是隨機變量,p 是概率且 q = 1-p。
函數 |
實現註解 |
---|---|
|
使用關係: pdf = αβ-α xα - 1 e-(x/beta)alpha |
cdf |
使用關係: p = -expm1(-(x/β)α) |
cdf 補集(complement) |
使用關係: q = e-(x/β)α |
分位點(quantile) |
使用關係: x = β * (-log1p(-p))1/α |
補集的分位點(quantile from the complement) |
使用關係: x = β * (-log(q))1/α |
均值(mean) |
β * Γ(1 + 1/α) |
方差(variance) |
β2(Γ(1 + 2/α) - Γ2(1 + 1/α)) |
眾數(mode) |
β((α - 1) / α)1/α |
偏斜(skewness) |
參考Weisstein, Eric W. "Weibull Distribution." From MathWorld--A Wolfram Web Resource. |
峰態(kurtosis) |
參考Weisstein, Eric W. "Weibull Distribution." From MathWorld--A Wolfram Web Resource. |
峰態超越(kurtosis excess ) |
參考Weisstein, Eric W. "Weibull Distribution." From MathWorld--A Wolfram Web Resource. |