ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkChiSquareDistribution.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkChiSquareDistribution_h
19 #define __itkChiSquareDistribution_h
20 
22 #include "itkNumericTraits.h"
23 
24 namespace itk
25 {
26 namespace Statistics
27 {
57 class ITK_EXPORT ChiSquareDistribution:
59 {
60 public:
66 
69 
71  itkNewMacro(Self);
72 
75  virtual SizeValueType GetNumberOfParameters() const { return 1; }
76 
79  virtual double EvaluatePDF(double x) const;
80 
84  virtual double EvaluatePDF(double x, const ParametersType &) const;
85 
88  virtual double EvaluatePDF(double x, SizeValueType degreesOfFreedom) const;
89 
92  virtual double EvaluateCDF(double x) const;
93 
97  virtual double EvaluateCDF(double x, const ParametersType &) const;
98 
101  virtual double EvaluateCDF(double x, SizeValueType degreesOfFreedom) const;
102 
106  virtual double EvaluateInverseCDF(double p) const;
107 
112  virtual double EvaluateInverseCDF(double p, const ParametersType &) const;
113 
117  virtual double EvaluateInverseCDF(double p, SizeValueType degreesOfFreedom) const;
118 
121  virtual void SetDegreesOfFreedom(SizeValueType);
122 
125  virtual SizeValueType GetDegreesOfFreedom() const;
126 
128  virtual bool HasMean() const { return true; }
129 
131  virtual double GetMean() const;
132 
134  virtual bool HasVariance() const { return true; }
135 
137  virtual double GetVariance() const;
138 
144  static double PDF(double x, const ParametersType &);
145 
150  static double PDF(double x, SizeValueType degreesOfFreedom);
151 
161  static double CDF(double x, const ParametersType &);
162 
171  static double CDF(double x, SizeValueType degreesOfFreedom);
172 
183  static double InverseCDF(double p, const ParametersType &);
184 
195  static double InverseCDF(double p, SizeValueType degreesOfFreedom);
196 
197 protected:
198  ChiSquareDistribution(void);
199  virtual ~ChiSquareDistribution(void) {}
200 
201  void PrintSelf(std::ostream & os, Indent indent) const;
202 
203 private:
204  ChiSquareDistribution(const Self &); //purposely not implemented
205  void operator=(const Self &); //purposely not implemented
206 }; // end of class
207 } // end of namespace Statistics
208 } // end namespace itk
209 
210 #endif
211