2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-21 15:12:28 +00:00
Files
math/doc/distributions/normal.qbk
John Maddock e602f59025 Added typedef to binomial: there is no longer any name clash with the "binomial_coefficient" function.
Updated distribution docs to bring them into synch with the policy based code.  Still a few "TODO" sections at present.

[SVN r7545]
2007-07-26 12:50:29 +00:00

100 lines
2.9 KiB
Plaintext

[section:normal_dist Normal (Gaussian) Distribution]
``#include <boost/math/distributions/normal.hpp>``
namespace boost{ namespace math{
template <class RealType = double,
class ``__Policy`` = ``__policy_class`` >
class normal_distribution;
typedef normal_distribution<> normal;
template <class RealType, class ``__Policy``>
class normal_distribution
{
public:
typedef RealType value_type;
typedef Policy policy_type;
// Construct:
normal_distribution(RealType mean = 0, RealType sd = 1);
// Accessors:
RealType mean()const;
RealType standard_deviation()const;
};
}} // namespaces
The normal distribution is probably the most well known statistical
distribution: it is also known as the Gaussian Distribution.
A normal distribution with mean zero and standard deviation one
is known as the ['Standard Normal Distribution].
Given mean [mu][space] and standard deviation [sigma][space] it has the PDF:
[$../equations/normal_ref1.png]
The variation the PDF with its parameters is illustrated
in the following graph:
[$../graphs/normal.png]
[h4 Member Functions]
normal_distribution(RealType mean = 0, RealType sd = 1);
Constructs a normal distribution with mean /mean/ and
standard deviation /sd/.
Requires sd > 0, otherwise __domain_error is called.
RealType mean()const;
Returns the /mean/ of this distribution.
RealType standard_deviation()const;
Returns the /standard deviation/ of this 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 variable is \[-[infin], +[infin]\].
[h4 Accuracy]
The normal distribution is implemented in terms of the
[link math_toolkit.special.sf_erf.error_function error function],
and as such should have very low error rates.
[h4 Implementation]
In the following table /m/ is the mean of the distribution,
and /s/ is its standard deviation.
[table
[[Function][Implementation Notes]]
[[pdf][Using the relation: pdf = e[super -(x-m)[super 2]\/(2s[super 2])] \/ (s * sqrt(2*pi)) ]]
[[cdf][Using the relation: p = 0.5 * __erfc(-(x-m)/(s*sqrt(2))) ]]
[[cdf complement][Using the relation: q = 0.5 * __erfc((x-m)/(s*sqrt(2))) ]]
[[quantile][Using the relation: x = m - s * sqrt(2) * __erfc_inv(2*p)]]
[[quantile from the complement][Using the relation: x = m + s * sqrt(2) * __erfc_inv(2*p)]]
[[mean and standard deviation][The same as `dist.mean()` and `dist.standard_deviation()`]]
[[mode][The same as the mean.]]
[[skewness][0]]
[[kurtosis][3]]
[[kurtosis excess][0]]
]
[endsect][/section:normal_dist Normal]
[/ normal.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).
]