File: extreme_value.qbk

package info (click to toggle)
boost1.49 1.49.0-3.2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 427,096 kB
  • sloc: cpp: 1,806,930; xml: 101,307; ansic: 43,491; python: 28,668; sh: 11,922; cs: 2,118; perl: 714; makefile: 671; yacc: 456; asm: 353; php: 116; lisp: 60; sql: 13; csh: 6
file content (119 lines) | stat: -rw-r--r-- 3,948 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
[section:extreme_dist Extreme Value Distribution]

``#include <boost/math/distributions/extreme.hpp>``

   template <class RealType = double, 
             class ``__Policy``   = ``__policy_class`` >
   class extreme_value_distribution;

   typedef extreme_value_distribution<> extreme_value;

   template <class RealType, class ``__Policy``>
   class extreme_value_distribution
   {
   public:
      typedef RealType value_type;

      extreme_value_distribution(RealType location = 0, RealType scale = 1);

      RealType scale()const;
      RealType location()const;
   };

There are various
[@http://mathworld.wolfram.com/ExtremeValueDistribution.html extreme value distributions]
: this implementation represents the maximum case,
and is variously known as a Fisher-Tippett distribution, 
a log-Weibull distribution or a Gumbel distribution. 

Extreme value theory is important for assessing risk for highly unusual events,
such as 100-year floods.

More information can be found on the 
[@http://www.itl.nist.gov/div898/handbook/eda/section3/eda366g.htm NIST],
[@http://en.wikipedia.org/wiki/Extreme_value_distribution Wikipedia],
[@http://mathworld.wolfram.com/ExtremeValueDistribution.html Mathworld],
and [@http://en.wikipedia.org/wiki/Extreme_value_theory Extreme value theory]
websites.

The relationship of the types of extreme value distributions, of which this is but one, is
discussed by
[@http://www.worldscibooks.com/mathematics/p191.html Extreme Value Distributions, Theory and Applications
Samuel Kotz & Saralees Nadarajah].

The distribution has a PDF given by:

f(x) = (1/scale) e[super -(x-location)/scale] e[super -e[super -(x-location)/scale]]

Which in the standard case (scale = 1, location = 0) reduces to:

f(x) = e[super -x]e[super -e[super -x]]

The following graph illustrates how the PDF varies with the location parameter:

[graph extreme_value_pdf1]

And this graph illustrates how the PDF varies with the shape parameter:

[graph extreme_value_pdf2]

[h4 Member Functions]

   extreme_value_distribution(RealType location = 0, RealType scale = 1);
   
Constructs an Extreme Value distribution with the specified location and scale
parameters.

Requires `scale > 0`, otherwise calls __domain_error.

   RealType location()const;
   
Returns the location parameter of the distribution.
   
   RealType scale()const;
   
Returns the scale parameter of the distribution.
   
[h4 Non-member Accessors]

All the [link math_toolkit.dist.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.

The domain of the random parameter is \[-[infin], +[infin]\].

[h4 Accuracy]

The extreme value distribution is implemented in terms of the 
standard library `exp` and `log` functions and as such should have very low
error rates.

[h4 Implementation]

In the following table:
/a/ is the location parameter, /b/ is the scale parameter,
/x/ is the random variate, /p/ is the probability and /q = 1-p/.

[table
[[Function][Implementation Notes]]
[[pdf][Using the relation: pdf = exp((a-x)/b) * exp(-exp((a-x)/b)) / b ]]
[[cdf][Using the relation: p = exp(-exp((a-x)/b)) ]]
[[cdf complement][Using the relation: q = -expm1(-exp((a-x)/b)) ]]
[[quantile][Using the relation: a - log(-log(p)) * b]]
[[quantile from the complement][Using the relation: a - log(-log1p(-q)) * b]]
[[mean][a + [@http://en.wikipedia.org/wiki/Euler-Mascheroni_constant Euler-Mascheroni-constant] * b]]
[[standard deviation][pi * b / sqrt(6)]]
[[mode][The same as the location parameter /a/.]]
[[skewness][12 * sqrt(6) * zeta(3) / pi[super 3] ]]
[[kurtosis][27 / 5]]
[[kurtosis excess][kurtosis - 3 or 12 / 5]]
]

[endsect][/section:extreme_dist Extreme Value]

[/ extreme_value.qbk
  Copyright 2006 John Maddock and Paul A. Bristow.
  Distributed under the Boost Software License, Version 1.0.
  (See accompanying file LICENSE_1_0.txt or copy at
  http://www.boost.org/LICENSE_1_0.txt).
]