ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
itk::Statistics::GaussianDistribution Class Reference

#include <itkGaussianDistribution.h>

Detailed Description

GaussianDistribution class defines the interface for a univariate Gaussian distribution (pdfs, cdfs, etc.).

GaussianDistribution provides access to the probability density function (pdf), the cumulative distribution function (cdf), and the inverse cumulative distribution function for a Gaussian distribution.

The EvaluatePDF(), EvaluateCDF, EvaluateInverseCDF() methods are all virtual, allowing algorithms to be written with an abstract interface to a distribution (with said distribution provided to the algorithm at run-time). Static methods, not requiring an instance of the distribution, are also provided. The static methods allow for optimized access to distributions when the distribution is known a priori to the algorithm.

GaussianDistributions are univariate. Multivariate versions may be provided under a separate superclass (since the parameters to the pdf and cdf would have to be vectors not scalars).

GaussianDistributions can be used for Z-score statistical tests.

Note
This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on the National Centers for Biomedical Computing can be obtained from http://commonfund.nih.gov/bioinformatics.
ITK Sphinx Examples:

Definition at line 61 of file itkGaussianDistribution.h.

+ Inheritance diagram for itk::Statistics::GaussianDistribution:
+ Collaboration diagram for itk::Statistics::GaussianDistribution:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = GaussianDistribution
 
using Superclass = ProbabilityDistribution
 
- Public Types inherited from itk::Statistics::ProbabilityDistribution
using ConstPointer = SmartPointer< const Self >
 
using ParametersType = Array< double >
 
using Pointer = SmartPointer< Self >
 
using Self = ProbabilityDistribution
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

double EvaluateCDF (double x) const override
 
double EvaluateCDF (double x, const ParametersType &) const override
 
virtual double EvaluateCDF (double x, double mean, double variance) const
 
double EvaluateInverseCDF (double p) const override
 
double EvaluateInverseCDF (double p, const ParametersType &) const override
 
virtual double EvaluateInverseCDF (double p, double mean, double variance) const
 
double EvaluatePDF (double x) const override
 
double EvaluatePDF (double x, const ParametersType &) const override
 
virtual double EvaluatePDF (double x, double mean, double variance) const
 
double GetMean () const override
 
const char * GetNameOfClass () const override
 
SizeValueType GetNumberOfParameters () const override
 
double GetVariance () const override
 
bool HasMean () const override
 
bool HasVariance () const override
 
virtual void SetMean (double)
 
virtual void SetVariance (double)
 
- Public Member Functions inherited from itk::Statistics::ProbabilityDistribution
const char * GetNameOfClass () const override
 
virtual const ParametersTypeGetParameters () const
 
virtual void SetParameters (const ParametersType &params)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *cmd) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
LightObject::Pointer CreateAnother () const override
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag) const
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static double CDF (double x)
 
static double CDF (double x, const ParametersType &)
 
static double CDF (double x, double mean, double variance)
 
static double InverseCDF (double p, const ParametersType &)
 
static double InverseCDF (double p, double mean, double variance)
 
static Pointer New ()
 
static double PDF (double x)
 
static double PDF (double x, const ParametersType &)
 
static double PDF (double x, double mean, double variance)
 
static double InverseCDF (double p)
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 GaussianDistribution ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~GaussianDistribution () override=default
 
- Protected Member Functions inherited from itk::Statistics::ProbabilityDistribution
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ProbabilityDistribution ()
 
 ~ProbabilityDistribution () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Additional Inherited Members

- Protected Attributes inherited from itk::Statistics::ProbabilityDistribution
ParametersType m_Parameters {}
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ ConstPointer

Definition at line 70 of file itkGaussianDistribution.h.

◆ Pointer

Definition at line 69 of file itkGaussianDistribution.h.

◆ Self

Standard class type aliases

Definition at line 67 of file itkGaussianDistribution.h.

◆ Superclass

Definition at line 68 of file itkGaussianDistribution.h.

Constructor & Destructor Documentation

◆ GaussianDistribution()

itk::Statistics::GaussianDistribution::GaussianDistribution ( )
protected

◆ ~GaussianDistribution()

itk::Statistics::GaussianDistribution::~GaussianDistribution ( )
overrideprotecteddefault

Member Function Documentation

◆ CDF() [1/3]

static double itk::Statistics::GaussianDistribution::CDF ( double  x)
static

Static method to evaluate the cumulative distribution function (cdf) of a standardized (mean zero, unit variance) Gaussian. The static method provides optimized access without requiring an instance of the class. Accuracy is approximately 10^-8.

◆ CDF() [2/3]

static double itk::Statistics::GaussianDistribution::CDF ( double  x,
const ParametersType  
)
static

Static method to evaluate the cumulative distribution function (cdf) of a Gaussian. The parameters of the distribution are passed as a parameter vector. The ordering of the parameters is (mean, variance). The static method provides optimized access without requiring an instance of the class.

◆ CDF() [3/3]

static double itk::Statistics::GaussianDistribution::CDF ( double  x,
double  mean,
double  variance 
)
static

Static method to evaluate the cumulative distribution function (cdf) of a Gaussian. The parameters of the distribution are passed as separate values. The static method provides optimized access without requiring an instance of the class.

◆ EvaluateCDF() [1/3]

double itk::Statistics::GaussianDistribution::EvaluateCDF ( double  x) const
overridevirtual

Evaluate the cumulative distribution function (cdf). The parameters of the distribution are assigned via SetParameters().

Implements itk::Statistics::ProbabilityDistribution.

◆ EvaluateCDF() [2/3]

double itk::Statistics::GaussianDistribution::EvaluateCDF ( double  x,
const ParametersType  
) const
overridevirtual

Evaluate the cumulative distribution function (cdf). The parameters for the distribution are passed as a parameters vector. The ordering of the parameters is (mean, variance).

Implements itk::Statistics::ProbabilityDistribution.

◆ EvaluateCDF() [3/3]

virtual double itk::Statistics::GaussianDistribution::EvaluateCDF ( double  x,
double  mean,
double  variance 
) const
virtual

Evaluate the cumulative distribution function (cdf). The parameters of the distribution are passed as separate parameters.

◆ EvaluateInverseCDF() [1/3]

double itk::Statistics::GaussianDistribution::EvaluateInverseCDF ( double  p) const
overridevirtual

Evaluate the inverse cumulative distribution function (inverse cdf). Parameter p must be between 0.0 and 1.0. The parameters of the distribution are assigned via SetParameters().

Implements itk::Statistics::ProbabilityDistribution.

◆ EvaluateInverseCDF() [2/3]

double itk::Statistics::GaussianDistribution::EvaluateInverseCDF ( double  p,
const ParametersType  
) const
overridevirtual

Evaluate the inverse cumulative distribution function (inverse cdf). Parameter p must be between 0.0 and 1.0. The parameters for the distribution are passed as a parameters vector. The ordering of the parameters is (mean, variance).

Implements itk::Statistics::ProbabilityDistribution.

◆ EvaluateInverseCDF() [3/3]

virtual double itk::Statistics::GaussianDistribution::EvaluateInverseCDF ( double  p,
double  mean,
double  variance 
) const
virtual

Evaluate the inverse cumulative distribution function (inverse cdf). Parameter p must be between 0.0 and 1.0. The parameters of the distribution are passed as separate parameters.

◆ EvaluatePDF() [1/3]

double itk::Statistics::GaussianDistribution::EvaluatePDF ( double  x) const
overridevirtual

Evaluate the probability density function (pdf). The parameters of the distribution are assigned via SetParameters().

Implements itk::Statistics::ProbabilityDistribution.

◆ EvaluatePDF() [2/3]

double itk::Statistics::GaussianDistribution::EvaluatePDF ( double  x,
const ParametersType  
) const
overridevirtual

Evaluate the probability density function (pdf). The parameters for the distribution are passed as a parameters vector. The ordering of the parameters is (mean, variance).

Implements itk::Statistics::ProbabilityDistribution.

◆ EvaluatePDF() [3/3]

virtual double itk::Statistics::GaussianDistribution::EvaluatePDF ( double  x,
double  mean,
double  variance 
) const
virtual

Evaluate the probability density function (pdf). The parameters of the distribution are passed as separate parameters.

◆ GetMean()

double itk::Statistics::GaussianDistribution::GetMean ( ) const
overridevirtual

Get the mean of the Gaussian distribution. Defaults to 0.0. The mean is stored in position 0 of the parameters vector.

Implements itk::Statistics::ProbabilityDistribution.

◆ GetNameOfClass()

const char* itk::Statistics::GaussianDistribution::GetNameOfClass ( ) const
overridevirtual
See also
LightObject::GetNameOfClass()

Reimplemented from itk::Object.

◆ GetNumberOfParameters()

SizeValueType itk::Statistics::GaussianDistribution::GetNumberOfParameters ( ) const
inlineoverridevirtual

Return the number of parameters. For a univariate Gaussian, this is 2 (mean, variance).

Implements itk::Statistics::ProbabilityDistribution.

Definition at line 81 of file itkGaussianDistribution.h.

◆ GetVariance()

double itk::Statistics::GaussianDistribution::GetVariance ( ) const
overridevirtual

Get the variance of the Gaussian distribution. Defaults to 1.0. The variance is stored in position 1 of the parameters vector.

Implements itk::Statistics::ProbabilityDistribution.

◆ HasMean()

bool itk::Statistics::GaussianDistribution::HasMean ( ) const
inlineoverridevirtual

Does this distribution have a mean?

Implements itk::Statistics::ProbabilityDistribution.

Definition at line 149 of file itkGaussianDistribution.h.

◆ HasVariance()

bool itk::Statistics::GaussianDistribution::HasVariance ( ) const
inlineoverridevirtual

Does this distribution have a variance?

Implements itk::Statistics::ProbabilityDistribution.

Definition at line 167 of file itkGaussianDistribution.h.

◆ InverseCDF() [1/3]

static double itk::Statistics::GaussianDistribution::InverseCDF ( double  p)
static

Static method to evaluate the inverse cumulative distribution function of a standardized (mean zero, unit variance) Gaussian. The static method provides optimized access without requiring an instance of the class. Parameter p must be between 0.0 and 1.0.

THis implementation was provided by Robert W. Cox from the Biophysics Research Institute at the Medical College of Wisconsin. This function is based off of a rational polynomial approximation to the inverse Gaussian CDF which can be found in M. Abramowitz and I.A. Stegun. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. John Wiley & Sons. New York. Equation 26.2.23. pg. 933. 1972.

Since the initial approximation only provides an estimate within 4.5 E-4 of the true value, 3 Newton-Raphson iterations are used to refine the approximation. Accuracy is approximately 10^-8.

Let, Q(x) = (1/sqrt(2*pi)) Int_{x}^{infinity} e^{-t^2/2} dt = 0.5 * erfc(x/sqrt(2))

Given p, this function computes x such that Q(x) = p, for 0 < p < 1

Note that the Gaussian CDF is defined as P(x) = (1/sqrt(2*pi)) Int_{-infinity}{x} e^{-t^2/2} dt = 1 - Q(x)

This function has been modified to compute the inverse of P(x) instead of Q(x).

◆ InverseCDF() [2/3]

static double itk::Statistics::GaussianDistribution::InverseCDF ( double  p,
const ParametersType  
)
static

Static method to evaluate the inverse cumulative distribution function of a Gaussian. The parameters of the distribution are passed as a parameter vector. The ordering of the parameters is (mean, variance). The static method provides optimized access without requiring an instance of the class. Parameter p must be between 0.0 and 1.0

◆ InverseCDF() [3/3]

static double itk::Statistics::GaussianDistribution::InverseCDF ( double  p,
double  mean,
double  variance 
)
static

Static method to evaluate the inverse cumulative distribution function of a Gaussian. The parameters of the distribution are passed as separate values. The static method provides optimized access without requiring an instance of the class. Parameter p must be between 0.0 and 1.0

◆ New()

static Pointer itk::Statistics::GaussianDistribution::New ( )
static

Method for creation through the object factory.

Examples
SphinxExamples/src/Numerics/Statistics/CreateGaussianDistribution/Code.cxx.

◆ PDF() [1/3]

static double itk::Statistics::GaussianDistribution::PDF ( double  x)
static

Static method to evaluate the probability density function (pdf) of a standardized (mean zero, unit variance) Gaussian. The static method provides optimized access without requiring an instance of the class.

◆ PDF() [2/3]

static double itk::Statistics::GaussianDistribution::PDF ( double  x,
const ParametersType  
)
static

Static method to evaluate the probability density function (pdf) of a Gaussian. The parameters of the distribution are passed as a parameter vector. The ordering of the parameters is (mean, variance). The static method provides optimized access without requiring an instance of the class.

◆ PDF() [3/3]

static double itk::Statistics::GaussianDistribution::PDF ( double  x,
double  mean,
double  variance 
)
static

Static method to evaluate the probability density function (pdf) of a Gaussian. The parameters of the distribution are passed as separate values. The static method provides optimized access without requiring an instance of the class.

◆ PrintSelf()

void itk::Statistics::GaussianDistribution::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::Object.

◆ SetMean()

virtual void itk::Statistics::GaussianDistribution::SetMean ( double  )
virtual

Set the mean of the Gaussian distribution. Defaults to 0.0. The mean is stored in position 0 of the parameters vector.

◆ SetVariance()

virtual void itk::Statistics::GaussianDistribution::SetVariance ( double  )
virtual

Set the variance of the Gaussian distribution. Defaults to 1.0. The variance is stored in position 1 of the parameters vector.


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