ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkChiSquareDistribution.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkChiSquareDistribution_h
00019 #define __itkChiSquareDistribution_h
00020 
00021 #include "itkProbabilityDistribution.h"
00022 #include "itkNumericTraits.h"
00023 
00024 namespace itk
00025 {
00026 namespace Statistics
00027 {
00057 class ITK_EXPORT ChiSquareDistribution:
00058   public ProbabilityDistribution
00059 {
00060 public:
00062   typedef ChiSquareDistribution      Self;
00063   typedef ProbabilityDistribution    Superclass;
00064   typedef SmartPointer< Self >       Pointer;
00065   typedef SmartPointer< const Self > ConstPointer;
00066 
00068   itkTypeMacro(ChiSquareDistribution, ProbabilityDistribution);
00069 
00071   itkNewMacro(Self);
00072 
00075   virtual SizeValueType GetNumberOfParameters() const { return 1; }
00076 
00079   virtual double EvaluatePDF(double x) const;
00080 
00084   virtual double EvaluatePDF(double x, const ParametersType &) const;
00085 
00088   virtual double EvaluatePDF(double x, SizeValueType degreesOfFreedom) const;
00089 
00092   virtual double EvaluateCDF(double x) const;
00093 
00097   virtual double EvaluateCDF(double x, const ParametersType &) const;
00098 
00101   virtual double EvaluateCDF(double x, SizeValueType degreesOfFreedom) const;
00102 
00106   virtual double EvaluateInverseCDF(double p) const;
00107 
00112   virtual double EvaluateInverseCDF(double p, const ParametersType &) const;
00113 
00117   virtual double EvaluateInverseCDF(double p, SizeValueType degreesOfFreedom) const;
00118 
00121   virtual void SetDegreesOfFreedom(SizeValueType);
00122 
00125   virtual SizeValueType GetDegreesOfFreedom() const;
00126 
00128   virtual bool HasMean() const { return true; }
00129 
00131   virtual double GetMean() const;
00132 
00134   virtual bool HasVariance() const { return true; }
00135 
00137   virtual double GetVariance() const;
00138 
00144   static double PDF(double x, const ParametersType &);
00145 
00150   static double PDF(double x, SizeValueType degreesOfFreedom);
00151 
00161   static double CDF(double x, const ParametersType &);
00162 
00171   static double CDF(double x, SizeValueType degreesOfFreedom);
00172 
00183   static double InverseCDF(double p, const ParametersType &);
00184 
00195   static double InverseCDF(double p, SizeValueType degreesOfFreedom);
00196 
00197 protected:
00198   ChiSquareDistribution(void);
00199   virtual ~ChiSquareDistribution(void) {}
00200 
00201   void PrintSelf(std::ostream & os, Indent indent) const;
00202 
00203 private:
00204   ChiSquareDistribution(const Self &); //purposely not implemented
00205   void operator=(const Self &);        //purposely not implemented
00206 };                                     // end of class
00207 } // end of namespace Statistics
00208 } // end namespace itk
00209 
00210 #endif
00211