ChiSquareDistribution Class Reference

The chi squared distribution. More...

#include <distributions.h>

Inheritance diagram for ChiSquareDistribution:

Distribution

List of all members.

Public Member Functions

 ChiSquareDistribution (double dof)
 Initializes the $\chi_a^2$ distribution.
double pdf (double x) const
double cdf (double x) const
 Returns the $P(X \le x)$ where $ X \sim \chi_a^2$.

Private Attributes

const double dof


Detailed Description

The chi squared distribution.

Constructor & Destructor Documentation

ChiSquareDistribution::ChiSquareDistribution ( double  dof  ) 

Initializes the $\chi_a^2$ distribution.

Parameters:
dof : The degrees of freedom, $a$.


Member Function Documentation

double ChiSquareDistribution::pdf ( double  x  )  const

double ChiSquareDistribution::cdf ( double  x  )  const

Returns the $P(X \le x)$ where $ X \sim \chi_a^2$.

Parameters:
x : the limit $x$ in $P(X \le x)$
Specifically,$P(X \le x)=\frac{\gamma(a/2,x/2)}{\Gamma(a/2)}$ where $x$ is the argument. However, to avoid the computation of large numbers this actually returns $P(X \le x)=e^{\log(\gamma(a/2,x/2))-\log(\Gamma(a/2))}$.


Member Data Documentation

const double ChiSquareDistribution::dof [private]


The documentation for this class was generated from the following files:

Documentation generated by  doxygen
Source code hosted by