StudentDistribution Class Reference
[Mathematical algorithms]

#include <StudentDistribution.hpp>

Inheritance diagram for StudentDistribution:

Inheritance graph
[legend]
Collaboration diagram for StudentDistribution:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class implements the t-Student distribution.

A typical way to use this class follows:

      // Declare a 'StudentDistribution' object with
      // 1 degree of freedom (default)
   StudentDistribution stuObj;

   double x(5.7);

   cout << stuObj.pdf(x) << " | "
        << stuObj.cdf(x) << " | "
        << stuObj.Q(x) << endl;

      // Now, the same but with four degrees of freedom
   cout << stuObj.pdf(x, 4) << " | "
        << stuObj.cdf(x, 4) << " | "
        << stuObj.Q(x, 4) << endl;

See also:
SpecialFunctions.hpp for useful functions, and GaussianDistribution.hpp for a normal distribution.

Definition at line 70 of file StudentDistribution.hpp.

Public Member Functions

 StudentDistribution ()
 Default constructor. Sets the number of degrees of freedom to 1.
 StudentDistribution (int n)
 Explicit constructor.
virtual double pdf (double x)
 Computes the probability density function.
virtual double pdf (double x, int n)
 Computes the probability density function.
virtual double cdf (double x)
 Computes the cumulative distribution function.
virtual double cdf (double x, int n)
 Computes the cumulative distribution function.
virtual double Q (double x)
 Computes the upper tail of the t-student probability function Q(x, ndf).
virtual double Q (double x, int n)
 Computes the upper tail of the t-student probability function Q(x, n).
virtual double getNDF (void) const
 Get number of degrees of freedom.
virtual StudentDistributionsetNDF (int n) throw (InvalidParameter)
 Set the number of degrees of freedom.


Constructor & Destructor Documentation

StudentDistribution  )  [inline]
 

Default constructor. Sets the number of degrees of freedom to 1.

Definition at line 76 of file StudentDistribution.hpp.

StudentDistribution int  n  )  [inline]
 

Explicit constructor.

Parameters:
n Degrees of freedom
Warning:
"n" must be > 0, otherwise n = |n|.

Definition at line 85 of file StudentDistribution.hpp.


Member Function Documentation

virtual double cdf double  x,
int  n
[inline, virtual]
 

Computes the cumulative distribution function.

Parameters:
x Value
n Degrees of freedom
Warning:
"n" must be > 0, otherwise n = |n|.

Definition at line 121 of file StudentDistribution.hpp.

double cdf double  x  )  [virtual]
 

Computes the cumulative distribution function.

Parameters:
x Value

Implements BaseDistribution.

Definition at line 80 of file StudentDistribution.cpp.

References gpstk::atan(), gpstk::regIncompleteBeta(), and gpstk::sqrt().

virtual double getNDF void   )  const [inline, virtual]
 

Get number of degrees of freedom.

Definition at line 147 of file StudentDistribution.hpp.

virtual double pdf double  x,
int  n
[inline, virtual]
 

Computes the probability density function.

Parameters:
x Value
n Degrees of freedom
Warning:
"n" must be > 0, otherwise n = |n|.

Definition at line 103 of file StudentDistribution.hpp.

double pdf double  x  )  [virtual]
 

Computes the probability density function.

Parameters:
x Value

Implements BaseDistribution.

Definition at line 45 of file StudentDistribution.cpp.

References gpstk::exp(), gpstk::lngamma(), PI, and gpstk::sqrt().

virtual double Q double  x,
int  n
[inline, virtual]
 

Computes the upper tail of the t-student probability function Q(x, n).

Parameters:
x Value
n Degrees of freedom
Warning:
"n" must be > 0, otherwise n = |n|.

Definition at line 142 of file StudentDistribution.hpp.

virtual double Q double  x  )  [inline, virtual]
 

Computes the upper tail of the t-student probability function Q(x, ndf).

Parameters:
x Value

Definition at line 130 of file StudentDistribution.hpp.

StudentDistribution & setNDF int  n  )  throw (InvalidParameter) [virtual]
 

Set the number of degrees of freedom.

Parameters:
n Degrees of freedom
Warning:
"n" must be > 0, otherwise n = |n|.

Definition at line 115 of file StudentDistribution.cpp.

References GPSTK_THROW.


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 03:31:41 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1