1 [section:normal_dist Normal (Gaussian) Distribution]
3 ``#include <boost/math/distributions/normal.hpp>``
5 namespace boost{ namespace math{
7 template <class RealType = double,
8 class ``__Policy`` = ``__policy_class`` >
9 class normal_distribution;
11 typedef normal_distribution<> normal;
13 template <class RealType, class ``__Policy``>
14 class normal_distribution
17 typedef RealType value_type;
18 typedef Policy policy_type;
20 normal_distribution(RealType mean = 0, RealType sd = 1);
22 RealType mean()const; // location.
23 RealType standard_deviation()const; // scale.
24 // Synonyms, provided to allow generic use of find_location and find_scale.
25 RealType location()const;
26 RealType scale()const;
31 The normal distribution is probably the most well known statistical
32 distribution: it is also known as the Gaussian Distribution.
33 A normal distribution with mean zero and standard deviation one
34 is known as the ['Standard Normal Distribution].
36 Given mean [mu][space]and standard deviation [sigma][space]it has the PDF:
38 [space] [equation normal_ref1]
40 The variation the PDF with its parameters is illustrated
41 in the following graph:
45 The cumulative distribution function is given by
47 [space] [equation normal_cdf]
49 and illustrated by this graph
56 normal_distribution(RealType mean = 0, RealType sd = 1);
58 Constructs a normal distribution with mean /mean/ and
59 standard deviation /sd/.
61 Requires sd > 0, otherwise __domain_error is called.
64 RealType location()const;
66 both return the /mean/ of this distribution.
68 RealType standard_deviation()const;
69 RealType scale()const;
71 both return the /standard deviation/ of this distribution.
72 (Redundant location and scale function are provided to match other similar distributions,
73 allowing the functions find_location and find_scale to be used generically).
75 [h4 Non-member Accessors]
77 All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] that are generic to all
78 distributions are supported: __usual_accessors.
80 The domain of the random variable is \[-[max_value], +[min_value]\].
81 However, the pdf of +[infin] and -[infin] = 0 is also supported,
82 and cdf at -[infin] = 0, cdf at +[infin] = 1,
83 and complement cdf -[infin] = 1 and +[infin] = 0,
88 The normal distribution is implemented in terms of the
89 [link math_toolkit.sf_erf.error_function error function],
90 and as such should have very low error rates.
94 In the following table /m/ is the mean of the distribution,
95 and /s/ is its standard deviation.
98 [[Function][Implementation Notes]]
99 [[pdf][Using the relation: pdf = e[super -(x-m)[super 2]\/(2s[super 2])] \/ (s * sqrt(2*pi)) ]]
100 [[cdf][Using the relation: p = 0.5 * __erfc(-(x-m)/(s*sqrt(2))) ]]
101 [[cdf complement][Using the relation: q = 0.5 * __erfc((x-m)/(s*sqrt(2))) ]]
102 [[quantile][Using the relation: x = m - s * sqrt(2) * __erfc_inv(2*p)]]
103 [[quantile from the complement][Using the relation: x = m + s * sqrt(2) * __erfc_inv(2*p)]]
104 [[mean and standard deviation][The same as `dist.mean()` and `dist.standard_deviation()`]]
105 [[mode][The same as the mean.]]
106 [[median][The same as the mean.]]
109 [[kurtosis excess][0]]
112 [endsect] [/section:normal_dist Normal]
115 Copyright 2006, 2007, 2012 John Maddock and Paul A. Bristow.
116 Distributed under the Boost Software License, Version 1.0.
117 (See accompanying file LICENSE_1_0.txt or copy at
118 http://www.boost.org/LICENSE_1_0.txt).