#include <boost/math/distributions/pareto.hpp>
namespace boost{ namespace math{ template <class RealType = double, class Policy = policies::policy<> > class pareto_distribution; typedef pareto_distribution<> pareto; template <class RealType, class Policy> class pareto_distribution { public: typedef RealType value_type; // Constructor: BOOST_MATH_GPU_ENABLED pareto_distribution(RealType scale = 1, RealType shape = 1) // Accessors: BOOST_MATH_GPU_ENABLED RealType scale()const; BOOST_MATH_GPU_ENABLED RealType shape()const; }; }} // namespaces
帕累托分布是一种连续分布,其概率密度函数 (pdf)为
f(x; α, β) = αβα / xα+ 1
对于形状参数 α > 0 和尺度参数 β > 0。如果 x < β,则 pdf 为零。
帕累托分布通常描述较大与较小之间的关系。一个经典的例子是 80% 的财富由 20% 的人口拥有。
下图说明了 PDF 如何随尺度参数 β 变化
下图说明了 PDF 如何随形状参数 α 变化
BOOST_MATH_GPU_ENABLED pareto_distribution(RealType scale = 1, RealType shape = 1);
构造一个具有形状 shape 和尺度 scale 的帕累托分布。
要求 shape 和 scale 参数都大于零,否则调用 domain_error。
BOOST_MATH_GPU_ENABLED RealType scale()const;
返回此分布的 scale 参数。
BOOST_MATH_GPU_ENABLED RealType shape()const;
返回此分布的 shape 参数。
支持所有常用的非成员访问器函数,这些函数是所有分布通用的:累积分布函数,概率密度函数,分位数,风险函数,累积风险函数,__logcdf,__logpdf,均值,中位数,众数,方差,标准差,偏度,峰度,超额峰度,范围 和 支持。对于此分布,所有非成员访问器函数都标有 BOOST_MATH_GPU_ENABLED
,并且可以在主机和设备上运行。
随机变量的supported domain是 [scale, ∞]。
在此分布中,logcdf
的实现经过专门设计,以提高数值精度。
帕累托分布是根据标准库 exp
函数加上 expm1 实现的,因此应该具有非常小的误差,通常只有几个 epsilon。
如果概率接近于 1(或概率的补数接近于零),另请参阅为什么使用补数?。
在下表中,α 是分布的形状参数,β 是其尺度参数,x 是随机变量,p 是概率,其补数 q = 1-p。
函数 |
实现说明 |
---|---|
|
使用关系式:pdf p = αβα/xα +1 |
cdf |
使用关系式:cdf p = 1 - (β / x)α |
logcdf |
log(cdf) = log1p(-pow(β/x, α)) |
cdf 补数 |
使用关系式:q = 1 - p = -(β / x)α |
分位数 |
使用关系式:x = β / (1 - p)1/α |
来自补数的分位数 |
使用关系式:x = β / (q)1/α |
均值 |
αβ / (β - 1) |
方差 |
βα2 / (β - 1)2 (β - 2) |
众数 |
α |
偏度 |
请参阅 Weisstein, Eric W. "帕累托分布"。来自 MathWorld--Wolfram Web 资源。 |
峰度 |
请参阅 Weisstein, Eric W. "帕累托分布"。来自 MathWorld--Wolfram Web 资源。 |
超额峰度 |
请参阅 Weisstein, Eric W. "帕累托分布"。来自 MathWorld--Wolfram Web 资源。 |