ITK  5.0.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 #include "ITKStatisticsExport.h"
24 
25 namespace itk
26 {
27 namespace Statistics
28 {
58 class ITKStatistics_EXPORT ChiSquareDistribution:
60 {
61 public:
62  ITK_DISALLOW_COPY_AND_ASSIGN(ChiSquareDistribution);
63 
69 
72 
74  itkNewMacro(Self);
75 
78  SizeValueType GetNumberOfParameters() const override { return 1; }
79 
82  double EvaluatePDF(double x) const override;
83 
87  double EvaluatePDF(double x, const ParametersType &) const override;
88 
91  virtual double EvaluatePDF(double x, SizeValueType degreesOfFreedom) const;
92 
95  double EvaluateCDF(double x) const override;
96 
100  double EvaluateCDF(double x, const ParametersType &) const override;
101 
104  virtual double EvaluateCDF(double x, SizeValueType degreesOfFreedom) const;
105 
109  double EvaluateInverseCDF(double p) const override;
110 
115  double EvaluateInverseCDF(double p, const ParametersType &) const override;
116 
120  virtual double EvaluateInverseCDF(double p, SizeValueType degreesOfFreedom) const;
121 
124  virtual void SetDegreesOfFreedom(SizeValueType);
125 
128  virtual SizeValueType GetDegreesOfFreedom() const;
129 
131  bool HasMean() const override { return true; }
132 
134  double GetMean() const override;
135 
137  bool HasVariance() const override { return true; }
138 
140  double GetVariance() const override;
141 
147  static double PDF(double x, const ParametersType &);
148 
153  static double PDF(double x, SizeValueType degreesOfFreedom);
154 
164  static double CDF(double x, const ParametersType &);
165 
174  static double CDF(double x, SizeValueType degreesOfFreedom);
175 
186  static double InverseCDF(double p, const ParametersType &);
187 
198  static double InverseCDF(double p, SizeValueType degreesOfFreedom);
199 
200 protected:
202  ~ChiSquareDistribution() override = default;
203 
204  void PrintSelf(std::ostream & os, Indent indent) const override;
205 }; // end of class
206 } // end of namespace Statistics
207 } // end namespace itk
208 
209 #endif
ChiSquareDistribution class defines the interface for a univariate Chi-Square distribution (pdfs...
Light weight base class for most itk classes.
ProbabilityDistribution class defines common interface for statistical distributions (pdfs...
unsigned long SizeValueType
Definition: itkIntTypes.h:83
SizeValueType GetNumberOfParameters() const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49