GaussianDistribution Class Reference
[Mathematical algorithms]

#include <GaussianDistribution.hpp>

Inheritance diagram for GaussianDistribution:

Inheritance graph
[legend]
Collaboration diagram for GaussianDistribution:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements the Gaussian (or normal) distribution.

A typical way to use this class follows:

      // Declare a  'GaussianDistribution' object, with nominal values
   GaussianDistribution normal;

      // Declare another, non-nominal 'GaussianDistribution' object.
   GaussianDistribution gauss(1.341, 0.176);

      // Print results for several values
   for(int i = 0; i < 1601; i++)
   {

      double x( -8.0 + ( static_cast<double>(i)/100.0 ) );

      cout << x << " | "
           << normal.pdf(x) << " | "
           << gauss.pdf(x) << " | "
           << normal.Q(x) << " | "
           << gauss.Q(x) << endl;

   }

See also:
SpecialFunctions.hpp for useful functions, and Chi2Distribution.hpp for a Chi-square distribution.

Definition at line 75 of file GaussianDistribution.hpp.

Public Member Functions

 GaussianDistribution ()
 Default constructor.
 GaussianDistribution (double mu, double sig)
 Explicit constructor.
virtual double pdf (double x)
 Computes the probability density function.
virtual double cdf (double x)
 Computes the cumulative distribution function.
virtual double Q (double x)
 Computes the upper tail of the Gaussian probability function Q(x).
virtual double invcdf (double p) throw (InvalidParameter)
 Computes the quantile function ( cdf^-1() ).
virtual double getMean (void) const
 Get mean.
virtual GaussianDistributionsetMean (double mu)
 Sets the mean.
virtual double getSigma (void) const
 Get standard deviation.
virtual GaussianDistributionsetSigma (double sig)
 Sets the standard deviation.
virtual GaussianDistributionsetParameters (double mu, double sig)
 Sets all parameters in one pass.


Constructor & Destructor Documentation

GaussianDistribution  ) 
 

Default constructor.

Sets a standard normal distribution: mean = 0.0, and standard deviation = 1.0.

Definition at line 44 of file GaussianDistribution.cpp.

GaussianDistribution double  mu,
double  sig
 

Explicit constructor.

Parameters:
mu Mean
sig Standard deviation
Warning:
If (sig <= 0.0), it will be set to 1.0.

Definition at line 61 of file GaussianDistribution.cpp.


Member Function Documentation

double cdf double  x  )  [virtual]
 

Computes the cumulative distribution function.

Parameters:
x Value

Implements BaseDistribution.

Definition at line 89 of file GaussianDistribution.cpp.

References gpstk::erf().

virtual double getMean void   )  const [inline, virtual]
 

Get mean.

Definition at line 131 of file GaussianDistribution.hpp.

virtual double getSigma void   )  const [inline, virtual]
 

Get standard deviation.

Definition at line 144 of file GaussianDistribution.hpp.

double invcdf double  p  )  throw (InvalidParameter) [virtual]
 

Computes the quantile function ( cdf^-1() ).

Parameters:
p Probability value
\ warning Value "p" must be in the range (0, 1)

Definition at line 106 of file GaussianDistribution.cpp.

References GPSTK_THROW, and gpstk::inverf().

double pdf double  x  )  [virtual]
 

Computes the probability density function.

Parameters:
x Value

Implements BaseDistribution.

Definition at line 76 of file GaussianDistribution.cpp.

References gpstk::exp().

virtual double Q double  x  )  [inline, virtual]
 

Computes the upper tail of the Gaussian probability function Q(x).

Parameters:
x Value

Definition at line 116 of file GaussianDistribution.hpp.

virtual GaussianDistribution& setMean double  mu  )  [inline, virtual]
 

Sets the mean.

Parameters:
mu Mean

Definition at line 139 of file GaussianDistribution.hpp.

GaussianDistribution & setParameters double  mu,
double  sig
[virtual]
 

Sets all parameters in one pass.

Parameters:
mu Mean
sig Standard deviation
Warning:
If (sig <= 0.0), it will be set to 1.0.

Definition at line 162 of file GaussianDistribution.cpp.

References GaussianDistribution::setSigma().

GaussianDistribution & setSigma double  sig  )  [virtual]
 

Sets the standard deviation.

Parameters:
sig Standard deviation
Warning:
If (sig <= 0.0), it will be set to 1.0.

Definition at line 137 of file GaussianDistribution.cpp.

Referenced by GaussianDistribution::setParameters().


The documentation for this class was generated from the following files:
Generated on Thu Jul 29 03:32:05 2010 for GPS ToolKit Software Library by  doxygen 1.3.9.1