Create Gaussian Distribution#

Synopsis#

Create a Gaussian distribution.

Results#

Output:

0.396953

Code#

C++#

#include "itkGaussianDistribution.h"

int
main()
{
  itk::Statistics::GaussianDistribution::Pointer gaussian = itk::Statistics::GaussianDistribution::New();
  gaussian->SetMean(2.0);
  gaussian->SetVariance(1.0);
  std::cout << gaussian->EvaluatePDF(2.1) << std::endl;
  return EXIT_SUCCESS;
}

Classes demonstrated#

class GaussianDistribution : public itk::Statistics::ProbabilityDistribution

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:

See itk::Statistics::GaussianDistribution for additional documentation.