3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Extreme Value Distribution</title>
5 <link rel="stylesheet" href="../../../math.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../index.html" title="Math Toolkit 2.5.2">
8 <link rel="up" href="../dists.html" title="Distributions">
9 <link rel="prev" href="exp_dist.html" title="Exponential Distribution">
10 <link rel="next" href="f_dist.html" title="F Distribution">
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>
22 <div class="spirit-nav">
23 <a accesskey="p" href="exp_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="f_dist.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="math_toolkit.dist_ref.dists.extreme_dist"></a><a class="link" href="extreme_dist.html" title="Extreme Value Distribution">Extreme Value
29 </h4></div></div></div>
30 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</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">extreme</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></pre>
31 <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">RealType</span> <span class="special">=</span> <span class="keyword">double</span><span class="special">,</span>
32 <span class="keyword">class</span> <a class="link" href="../../../policy.html" title="Chapter 15. 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<></a> <span class="special">></span>
33 <span class="keyword">class</span> <span class="identifier">extreme_value_distribution</span><span class="special">;</span>
35 <span class="keyword">typedef</span> <span class="identifier">extreme_value_distribution</span><span class="special"><></span> <span class="identifier">extreme_value</span><span class="special">;</span>
37 <span class="keyword">template</span> <span class="special"><</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 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span>
38 <span class="keyword">class</span> <span class="identifier">extreme_value_distribution</span>
39 <span class="special">{</span>
40 <span class="keyword">public</span><span class="special">:</span>
41 <span class="keyword">typedef</span> <span class="identifier">RealType</span> <span class="identifier">value_type</span><span class="special">;</span>
43 <span class="identifier">extreme_value_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">location</span> <span class="special">=</span> <span class="number">0</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>
45 <span class="identifier">RealType</span> <span class="identifier">scale</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
46 <span class="identifier">RealType</span> <span class="identifier">location</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
47 <span class="special">};</span>
50 There are various <a href="http://mathworld.wolfram.com/ExtremeValueDistribution.html" target="_top">extreme
51 value distributions</a> : this implementation represents the maximum
52 case, and is variously known as a Fisher-Tippett distribution, a log-Weibull
53 distribution or a Gumbel distribution.
56 Extreme value theory is important for assessing risk for highly unusual
57 events, such as 100-year floods.
60 More information can be found on the <a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda366g.htm" target="_top">NIST</a>,
61 <a href="http://en.wikipedia.org/wiki/Extreme_value_distribution" target="_top">Wikipedia</a>,
62 <a href="http://mathworld.wolfram.com/ExtremeValueDistribution.html" target="_top">Mathworld</a>,
63 and <a href="http://en.wikipedia.org/wiki/Extreme_value_theory" target="_top">Extreme
64 value theory</a> websites.
67 The relationship of the types of extreme value distributions, of which
68 this is but one, is discussed by <a href="http://www.worldscibooks.com/mathematics/p191.html" target="_top">Extreme
69 Value Distributions, Theory and Applications Samuel Kotz & Saralees
73 The distribution has a PDF given by:
76 f(x) = (1/scale) e<sup>-(x-location)/scale</sup> e<sup>-e<sup>-(x-location)/scale</sup></sup>
79 Which in the standard case (scale = 1, location = 0) reduces to:
82 f(x) = e<sup>-x</sup>e<sup>-e<sup>-x</sup></sup>
85 The following graph illustrates how the PDF varies with the location parameter:
88 <span class="inlinemediaobject"><img src="../../../../graphs/extreme_value_pdf1.svg" align="middle"></span>
91 And this graph illustrates how the PDF varies with the shape parameter:
94 <span class="inlinemediaobject"><img src="../../../../graphs/extreme_value_pdf2.svg" align="middle"></span>
97 <a name="math_toolkit.dist_ref.dists.extreme_dist.h0"></a>
98 <span class="phrase"><a name="math_toolkit.dist_ref.dists.extreme_dist.member_functions"></a></span><a class="link" href="extreme_dist.html#math_toolkit.dist_ref.dists.extreme_dist.member_functions">Member
101 <pre class="programlisting"><span class="identifier">extreme_value_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">location</span> <span class="special">=</span> <span class="number">0</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>
104 Constructs an Extreme Value distribution with the specified location and
108 Requires <code class="computeroutput"><span class="identifier">scale</span> <span class="special">></span>
109 <span class="number">0</span></code>, otherwise calls <a class="link" href="../../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>.
111 <pre class="programlisting"><span class="identifier">RealType</span> <span class="identifier">location</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
114 Returns the location parameter of the distribution.
116 <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>
119 Returns the scale parameter of the distribution.
122 <a name="math_toolkit.dist_ref.dists.extreme_dist.h1"></a>
123 <span class="phrase"><a name="math_toolkit.dist_ref.dists.extreme_dist.non_member_accessors"></a></span><a class="link" href="extreme_dist.html#math_toolkit.dist_ref.dists.extreme_dist.non_member_accessors">Non-member
127 All the <a class="link" href="../nmp.html" title="Non-Member Properties">usual non-member accessor
128 functions</a> that are generic to all distributions are supported:
129 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative Distribution Function</a>,
130 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability Density Function</a>,
131 <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>,
132 <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>,
133 <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>,
134 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.sd">standard deviation</a>,
135 <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>,
136 <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>.
139 The domain of the random parameter is [-∞, +∞].
142 <a name="math_toolkit.dist_ref.dists.extreme_dist.h2"></a>
143 <span class="phrase"><a name="math_toolkit.dist_ref.dists.extreme_dist.accuracy"></a></span><a class="link" href="extreme_dist.html#math_toolkit.dist_ref.dists.extreme_dist.accuracy">Accuracy</a>
146 The extreme value distribution is implemented in terms of the standard
147 library <code class="computeroutput"><span class="identifier">exp</span></code> and <code class="computeroutput"><span class="identifier">log</span></code> functions and as such should have
148 very low error rates.
151 <a name="math_toolkit.dist_ref.dists.extreme_dist.h3"></a>
152 <span class="phrase"><a name="math_toolkit.dist_ref.dists.extreme_dist.implementation"></a></span><a class="link" href="extreme_dist.html#math_toolkit.dist_ref.dists.extreme_dist.implementation">Implementation</a>
155 In the following table: <span class="emphasis"><em>a</em></span> is the location parameter,
156 <span class="emphasis"><em>b</em></span> is the scale parameter, <span class="emphasis"><em>x</em></span> is
157 the random variate, <span class="emphasis"><em>p</em></span> is the probability and <span class="emphasis"><em>q
160 <div class="informaltable"><table class="table">
186 Using the relation: pdf = exp((a-x)/b) * exp(-exp((a-x)/b)) /
199 Using the relation: p = exp(-exp((a-x)/b))
211 Using the relation: q = -expm1(-exp((a-x)/b))
223 Using the relation: a - log(-log(p)) * b
230 quantile from the complement
235 Using the relation: a - log(-log1p(-q)) * b
247 a + <a href="http://en.wikipedia.org/wiki/Euler-Mascheroni_constant" target="_top">Euler-Mascheroni-constant</a>
272 The same as the location parameter <span class="emphasis"><em>a</em></span>.
284 12 * sqrt(6) * zeta(3) / pi<sup>3</sup>
308 kurtosis - 3 or 12 / 5
315 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
316 <td align="left"></td>
317 <td align="right"><div class="copyright-footer">Copyright © 2006-2010, 2012-2014 Nikhar Agrawal,
318 Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
319 Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan Råde, Gautam Sewani,
320 Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p>
321 Distributed under the Boost Software License, Version 1.0. (See accompanying
322 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>)
327 <div class="spirit-nav">
328 <a accesskey="p" href="exp_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="f_dist.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>