![]() |
Home | Libraries | People | FAQ | More |
#include <boost/math/distributions/rayleigh.hpp>
namespace boost{ namespace math{ template <class RealType = double, class Policy = policies::policy<> > class rayleigh_distribution; typedef rayleigh_distribution<> rayleigh; template <class RealType, class Policy> class rayleigh_distribution { public: typedef RealType value_type; typedef Policy policy_type; // 構造: rayleigh_distribution(RealType sigma = 1) // 訪問函數(Accessors): RealType sigma()const; }; }} // namespaces
瑞利分佈(Rayleigh distribution) 是一個連續分佈,概率密度函數(probability density function為:
f(x; sigma) = x * exp(-x2/2 σ2) / σ2
對於 σ 參數 : σ > 0, 且 x > 0。
瑞利分佈(Rayleigh distribution) 通常在兩個正交補(orthogonal components)有一個絕對值(absolute value)時使用,例如,風速(wind velocity)和風向(wind direction)可以組合用來產生風速(wind speed),或都實部(real component)和虛部(imaginary component)的絕對值可能是依據瑞利分佈(Rayleigh Distribution)而分佈的。
下面的圖像顯示了當形狀參數(shape parameter) σ發生變化時,概率密度函數(Probability density Function(pdf))是如何變化的:
以及累積分佈函數( Cumulative Distribution Function (cdf))
兩個相互獨立的正態分佈(normal distributions) X 和 Y的絕對值(absolute value)√ (X2 + Y2) 是一個瑞利分佈(Rayleigh distribution)。
χ,Rice 和韋伯爾(Weibull) 分佈是瑞利分佈(Rayleigh distribution)的一般化。
rayleigh_distribution(RealType sigma = 1);
使用σ sigma構造一個瑞利分佈(Rayleigh distribution) 。
要求: σ 參數大於0,否則調用定義域錯誤。
RealType sigma()const;
返回分佈的sigma 參數。
支持所有的分佈都通用的 常見的非成員訪問函數 : 累積分佈函數(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, max_value]。
瑞利分佈(Rayleigh distribution)使用標準庫函數sqrt 和 exp 實現,因此誤差率(error rate)很低。一些常量,例如,偏斜(skewness)和峰態(kurtosis)使用精確度為150-bit的NTL RR類型來計算,大約有50位有效數字。
在下面的表中:σ 是 sigma 參數,x 是隨機變量,p 是概率且 q = 1-p。
|
函數 |
實現註解 |
|---|---|
|
|
使用關係: pdf = x * exp(-x2)/2 σ2 |
|
cdf |
使用關係: p = 1 - exp(-x2/2) σ2 = -expm1(-x2/2) σ2 |
|
cdf 補集(complement) |
使用關係: q = exp(-x2/ 2) * σ2 |
|
分位點(quantile) |
使用關係: x = sqrt(-2 * σ 2) * log(1 - p)) = sqrt(-2 * σ 2) * log1p(-p)) |
|
補集的分位點(quantile from the complement) |
使用關係: x = sqrt(-2 * σ 2) * log(q)) |
|
均值(mean) |
σ * sqrt(π/2) |
|
方差(variance) |
σ2 * (4 - π/2) |
|
眾數(mode) |
σ |
|
偏斜(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. |