]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/doc/distributions/lognormal.qbk
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / math / doc / distributions / lognormal.qbk
1 [section:lognormal_dist Log Normal Distribution]
2
3 ``#include <boost/math/distributions/lognormal.hpp>``
4
5 namespace boost{ namespace math{
6
7 template <class RealType = double,
8 class ``__Policy`` = ``__policy_class`` >
9 class lognormal_distribution;
10
11 typedef lognormal_distribution<> lognormal;
12
13 template <class RealType, class ``__Policy``>
14 class lognormal_distribution
15 {
16 public:
17 typedef RealType value_type;
18 typedef Policy policy_type;
19 // Construct:
20 lognormal_distribution(RealType location = 0, RealType scale = 1);
21 // Accessors:
22 RealType location()const;
23 RealType scale()const;
24 };
25
26 }} // namespaces
27
28 The lognormal distribution is the distribution that arises
29 when the logarithm of the random variable is normally distributed.
30 A lognormal distribution results when the variable is the product
31 of a large number of independent, identically-distributed variables.
32
33 For location and scale parameters /m/ and /s/ it is defined by the
34 probability density function:
35
36 [equation lognormal_ref]
37
38 The location and scale parameters are equivalent to the mean and
39 standard deviation of the logarithm of the random variable.
40
41 The following graph illustrates the effect of the location
42 parameter on the PDF, note that the range of the random
43 variable remains \[0,+[infin]\] irrespective of the value of the
44 location parameter:
45
46 [graph lognormal_pdf1]
47
48 The next graph illustrates the effect of the scale parameter on the PDF:
49
50 [graph lognormal_pdf2]
51
52 [h4 Member Functions]
53
54 lognormal_distribution(RealType location = 0, RealType scale = 1);
55
56 Constructs a lognormal distribution with location /location/ and
57 scale /scale/.
58
59 The location parameter is the same as the mean of the logarithm of the
60 random variate.
61
62 The scale parameter is the same as the standard deviation of the
63 logarithm of the random variate.
64
65 Requires that the scale parameter is greater than zero, otherwise calls
66 __domain_error.
67
68 RealType location()const;
69
70 Returns the /location/ parameter of this distribution.
71
72 RealType scale()const;
73
74 Returns the /scale/ parameter of this distribution.
75
76 [h4 Non-member Accessors]
77
78 All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] that are generic to all
79 distributions are supported: __usual_accessors.
80
81 The domain of the random variable is \[0,+[infin]\].
82
83 [h4 Accuracy]
84
85 The lognormal distribution is implemented in terms of the
86 standard library log and exp functions, plus the
87 [link math_toolkit.sf_erf.error_function error function],
88 and as such should have very low error rates.
89
90 [h4 Implementation]
91
92 In the following table /m/ is the location parameter of the distribution,
93 /s/ is its scale parameter, /x/ is the random variate, /p/ is the probability
94 and /q = 1-p/.
95
96 [table
97 [[Function][Implementation Notes]]
98 [[pdf][Using the relation: pdf = e[super -(ln(x) - m)[super 2 ] \/ 2s[super 2 ] ] \/ (x * s * sqrt(2pi)) ]]
99 [[cdf][Using the relation: p = cdf(normal_distribtion<RealType>(m, s), log(x)) ]]
100 [[cdf complement][Using the relation: q = cdf(complement(normal_distribtion<RealType>(m, s), log(x))) ]]
101 [[quantile][Using the relation: x = exp(quantile(normal_distribtion<RealType>(m, s), p))]]
102 [[quantile from the complement][Using the relation: x = exp(quantile(complement(normal_distribtion<RealType>(m, s), q)))]]
103 [[mean][e[super m + s[super 2 ] / 2 ] ]]
104 [[variance][(e[super s[super 2] ] - 1) * e[super 2m + s[super 2 ] ] ]]
105 [[mode][e[super m - s[super 2 ] ] ]]
106 [[skewness][sqrt(e[super s[super 2] ] - 1) * (2 + e[super s[super 2] ]) ]]
107 [[kurtosis][e[super 4s[super 2] ] + 2e[super 3s[super 2] ] + 3e[super 2s[super 2] ] - 3]]
108 [[kurtosis excess][e[super 4s[super 2] ] + 2e[super 3s[super 2] ] + 3e[super 2s[super 2] ] - 6 ]]
109 ]
110
111 [endsect][/section:normal_dist Normal]
112
113 [/
114 Copyright 2006 John Maddock and Paul A. Bristow.
115 Distributed under the Boost Software License, Version 1.0.
116 (See accompanying file LICENSE_1_0.txt or copy at
117 http://www.boost.org/LICENSE_1_0.txt).
118 ]
119