]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/doc/html/math_toolkit/dist_ref/dists/pareto.html
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / math / doc / html / math_toolkit / dist_ref / dists / pareto.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Pareto Distribution</title>
5 <link rel="stylesheet" href="../../../math.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7 <link rel="home" href="../../../index.html" title="Math Toolkit 2.5.1">
8 <link rel="up" href="../dists.html" title="Distributions">
9 <link rel="prev" href="normal_dist.html" title="Normal (Gaussian) Distribution">
10 <link rel="next" href="poisson_dist.html" title="Poisson Distribution">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="normal_dist.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dists.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="poisson_dist.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="math_toolkit.dist_ref.dists.pareto"></a><a class="link" href="pareto.html" title="Pareto Distribution">Pareto Distribution</a>
28 </h4></div></div></div>
29 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">pareto</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></pre>
30 <pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span>
31
32 <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">RealType</span> <span class="special">=</span> <span class="keyword">double</span><span class="special">,</span>
33 <span class="keyword">class</span> <a class="link" href="../../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> <span class="special">=</span> <a class="link" href="../../pol_ref/pol_ref_ref.html" title="Policy Class Reference">policies::policy&lt;&gt;</a> <span class="special">&gt;</span>
34 <span class="keyword">class</span> <span class="identifier">pareto_distribution</span><span class="special">;</span>
35
36 <span class="keyword">typedef</span> <span class="identifier">pareto_distribution</span><span class="special">&lt;&gt;</span> <span class="identifier">pareto</span><span class="special">;</span>
37
38 <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../../policy.html" title="Chapter&#160;15.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&gt;</span>
39 <span class="keyword">class</span> <span class="identifier">pareto_distribution</span>
40 <span class="special">{</span>
41 <span class="keyword">public</span><span class="special">:</span>
42 <span class="keyword">typedef</span> <span class="identifier">RealType</span> <span class="identifier">value_type</span><span class="special">;</span>
43 <span class="comment">// Constructor:</span>
44 <span class="identifier">pareto_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">scale</span> <span class="special">=</span> <span class="number">1</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">shape</span> <span class="special">=</span> <span class="number">1</span><span class="special">)</span>
45 <span class="comment">// Accessors:</span>
46 <span class="identifier">RealType</span> <span class="identifier">scale</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
47 <span class="identifier">RealType</span> <span class="identifier">shape</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
48 <span class="special">};</span>
49
50 <span class="special">}}</span> <span class="comment">// namespaces</span>
51 </pre>
52 <p>
53 The <a href="http://en.wikipedia.org/wiki/pareto_distribution" target="_top">Pareto
54 distribution</a> is a continuous distribution with the <a href="http://en.wikipedia.org/wiki/Probability_density_function" target="_top">probability
55 density function (pdf)</a>:
56 </p>
57 <p>
58 f(x; &#945;, &#946;) = &#945;&#946;<sup>&#945;</sup> / x<sup>&#945;+ 1</sup>
59 </p>
60 <p>
61 For shape parameter &#945; &#160; &gt; 0, and scale parameter &#946; &#160; &gt; 0. If x &lt; &#946; &#160;, the
62 pdf is zero.
63 </p>
64 <p>
65 The <a href="http://mathworld.wolfram.com/ParetoDistribution.html" target="_top">Pareto
66 distribution</a> often describes the larger compared to the smaller.
67 A classic example is that 80% of the wealth is owned by 20% of the population.
68 </p>
69 <p>
70 The following graph illustrates how the PDF varies with the scale parameter
71 &#946;:
72 </p>
73 <p>
74 <span class="inlinemediaobject"><img src="../../../../graphs/pareto_pdf1.svg" align="middle"></span>
75 </p>
76 <p>
77 And this graph illustrates how the PDF varies with the shape parameter
78 &#945;:
79 </p>
80 <p>
81 <span class="inlinemediaobject"><img src="../../../../graphs/pareto_pdf2.svg" align="middle"></span>
82 </p>
83 <h5>
84 <a name="math_toolkit.dist_ref.dists.pareto.h0"></a>
85 <span class="phrase"><a name="math_toolkit.dist_ref.dists.pareto.related_distributions"></a></span><a class="link" href="pareto.html#math_toolkit.dist_ref.dists.pareto.related_distributions">Related
86 distributions</a>
87 </h5>
88 <h5>
89 <a name="math_toolkit.dist_ref.dists.pareto.h1"></a>
90 <span class="phrase"><a name="math_toolkit.dist_ref.dists.pareto.member_functions"></a></span><a class="link" href="pareto.html#math_toolkit.dist_ref.dists.pareto.member_functions">Member Functions</a>
91 </h5>
92 <pre class="programlisting"><span class="identifier">pareto_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">scale</span> <span class="special">=</span> <span class="number">1</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">shape</span> <span class="special">=</span> <span class="number">1</span><span class="special">);</span>
93 </pre>
94 <p>
95 Constructs a <a href="http://en.wikipedia.org/wiki/pareto_distribution" target="_top">pareto
96 distribution</a> with shape <span class="emphasis"><em>shape</em></span> and scale <span class="emphasis"><em>scale</em></span>.
97 </p>
98 <p>
99 Requires that the <span class="emphasis"><em>shape</em></span> and <span class="emphasis"><em>scale</em></span>
100 parameters are both greater than zero, otherwise calls <a class="link" href="../../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>.
101 </p>
102 <pre class="programlisting"><span class="identifier">RealType</span> <span class="identifier">scale</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
103 </pre>
104 <p>
105 Returns the <span class="emphasis"><em>scale</em></span> parameter of this distribution.
106 </p>
107 <pre class="programlisting"><span class="identifier">RealType</span> <span class="identifier">shape</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
108 </pre>
109 <p>
110 Returns the <span class="emphasis"><em>shape</em></span> parameter of this distribution.
111 </p>
112 <h5>
113 <a name="math_toolkit.dist_ref.dists.pareto.h2"></a>
114 <span class="phrase"><a name="math_toolkit.dist_ref.dists.pareto.non_member_accessors"></a></span><a class="link" href="pareto.html#math_toolkit.dist_ref.dists.pareto.non_member_accessors">Non-member
115 Accessors</a>
116 </h5>
117 <p>
118 All the <a class="link" href="../nmp.html" title="Non-Member Properties">usual non-member accessor
119 functions</a> that are generic to all distributions are supported:
120 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative Distribution Function</a>,
121 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability Density Function</a>,
122 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.quantile">Quantile</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.hazard">Hazard Function</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.chf">Cumulative Hazard Function</a>,
123 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.mean">mean</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.median">median</a>,
124 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.mode">mode</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.variance">variance</a>,
125 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.sd">standard deviation</a>,
126 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.skewness">skewness</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.kurtosis">kurtosis</a>, <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.kurtosis_excess">kurtosis_excess</a>,
127 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.range">range</a> and <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.support">support</a>.
128 </p>
129 <p>
130 The supported domain of the random variable is [scale, &#8734;].
131 </p>
132 <h5>
133 <a name="math_toolkit.dist_ref.dists.pareto.h3"></a>
134 <span class="phrase"><a name="math_toolkit.dist_ref.dists.pareto.accuracy"></a></span><a class="link" href="pareto.html#math_toolkit.dist_ref.dists.pareto.accuracy">Accuracy</a>
135 </h5>
136 <p>
137 The Pareto distribution is implemented in terms of the standard library
138 <code class="computeroutput"><span class="identifier">exp</span></code> functions plus <a class="link" href="../../powers/expm1.html" title="expm1">expm1</a> and so should have very
139 small errors, usually only a few epsilon.
140 </p>
141 <p>
142 If probability is near to unity (or the complement of a probability near
143 zero) see also <a class="link" href="../../stat_tut/overview/complements.html#why_complements">why complements?</a>.
144 </p>
145 <h5>
146 <a name="math_toolkit.dist_ref.dists.pareto.h4"></a>
147 <span class="phrase"><a name="math_toolkit.dist_ref.dists.pareto.implementation"></a></span><a class="link" href="pareto.html#math_toolkit.dist_ref.dists.pareto.implementation">Implementation</a>
148 </h5>
149 <p>
150 In the following table &#945; &#160; is the shape parameter of the distribution, and
151 &#946; &#160; is its scale parameter, <span class="emphasis"><em>x</em></span> is the random variate,
152 <span class="emphasis"><em>p</em></span> is the probability and its complement <span class="emphasis"><em>q
153 = 1-p</em></span>.
154 </p>
155 <div class="informaltable"><table class="table">
156 <colgroup>
157 <col>
158 <col>
159 </colgroup>
160 <thead><tr>
161 <th>
162 <p>
163 Function
164 </p>
165 </th>
166 <th>
167 <p>
168 Implementation Notes
169 </p>
170 </th>
171 </tr></thead>
172 <tbody>
173 <tr>
174 <td>
175 <p>
176 pdf
177 </p>
178 </td>
179 <td>
180 <p>
181 Using the relation: pdf p = &#945;&#946;<sup>&#945;</sup>/x<sup>&#945; +1</sup>
182 </p>
183 </td>
184 </tr>
185 <tr>
186 <td>
187 <p>
188 cdf
189 </p>
190 </td>
191 <td>
192 <p>
193 Using the relation: cdf p = 1 - (&#946; &#160; / x)<sup>&#945;</sup>
194 </p>
195 </td>
196 </tr>
197 <tr>
198 <td>
199 <p>
200 cdf complement
201 </p>
202 </td>
203 <td>
204 <p>
205 Using the relation: q = 1 - p = -(&#946; &#160; / x)<sup>&#945;</sup>
206 </p>
207 </td>
208 </tr>
209 <tr>
210 <td>
211 <p>
212 quantile
213 </p>
214 </td>
215 <td>
216 <p>
217 Using the relation: x = &#946; / (1 - p)<sup>1/&#945;</sup>
218 </p>
219 </td>
220 </tr>
221 <tr>
222 <td>
223 <p>
224 quantile from the complement
225 </p>
226 </td>
227 <td>
228 <p>
229 Using the relation: x = &#946; / (q)<sup>1/&#945;</sup>
230 </p>
231 </td>
232 </tr>
233 <tr>
234 <td>
235 <p>
236 mean
237 </p>
238 </td>
239 <td>
240 <p>
241 &#945;&#946; / (&#946; - 1)
242 </p>
243 </td>
244 </tr>
245 <tr>
246 <td>
247 <p>
248 variance
249 </p>
250 </td>
251 <td>
252 <p>
253 &#946;&#945;<sup>2</sup> / (&#946; - 1)<sup>2</sup> (&#946; - 2)
254 </p>
255 </td>
256 </tr>
257 <tr>
258 <td>
259 <p>
260 mode
261 </p>
262 </td>
263 <td>
264 <p>
265 &#945;
266 </p>
267 </td>
268 </tr>
269 <tr>
270 <td>
271 <p>
272 skewness
273 </p>
274 </td>
275 <td>
276 <p>
277 Refer to <a href="http://mathworld.wolfram.com/ParetoDistribution.html" target="_top">Weisstein,
278 Eric W. "Pareto Distribution." From MathWorld--A Wolfram
279 Web Resource.</a>
280 </p>
281 </td>
282 </tr>
283 <tr>
284 <td>
285 <p>
286 kurtosis
287 </p>
288 </td>
289 <td>
290 <p>
291 Refer to <a href="http://mathworld.wolfram.com/ParetoDistribution.html" target="_top">Weisstein,
292 Eric W. "Pareto Distribution." From MathWorld--A Wolfram
293 Web Resource.</a>
294 </p>
295 </td>
296 </tr>
297 <tr>
298 <td>
299 <p>
300 kurtosis excess
301 </p>
302 </td>
303 <td>
304 <p>
305 Refer to <a href="http://mathworld.wolfram.com/ParetoDistribution.html" target="_top">Weisstein,
306 Eric W. "pareto Distribution." From MathWorld--A Wolfram
307 Web Resource.</a>
308 </p>
309 </td>
310 </tr>
311 </tbody>
312 </table></div>
313 <h5>
314 <a name="math_toolkit.dist_ref.dists.pareto.h5"></a>
315 <span class="phrase"><a name="math_toolkit.dist_ref.dists.pareto.references"></a></span><a class="link" href="pareto.html#math_toolkit.dist_ref.dists.pareto.references">References</a>
316 </h5>
317 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
318 <li class="listitem">
319 <a href="http://en.wikipedia.org/wiki/pareto_distribution" target="_top">Pareto
320 Distribution</a>
321 </li>
322 <li class="listitem">
323 <a href="http://mathworld.wolfram.com/paretoDistribution.html" target="_top">Weisstein,
324 Eric W. "Pareto Distribution." From MathWorld--A Wolfram
325 Web Resource.</a>
326 </li>
327 <li class="listitem">
328 Handbook of Statistical Distributions with Applications, K Krishnamoorthy,
329 ISBN 1-58488-635-8, Chapter 23, pp 257 - 267. (Note the meaning of
330 a and b is reversed in Wolfram and Krishnamoorthy).
331 </li>
332 </ul></div>
333 </div>
334 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
335 <td align="left"></td>
336 <td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014 Nikhar Agrawal,
337 Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
338 Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam Sewani,
339 Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p>
340 Distributed under the Boost Software License, Version 1.0. (See accompanying
341 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
342 </p>
343 </div></td>
344 </tr></table>
345 <hr>
346 <div class="spirit-nav">
347 <a accesskey="p" href="normal_dist.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dists.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="poisson_dist.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
348 </div>
349 </body>
350 </html>