ITK  5.2.0
Insight Toolkit
itkChiSquareDistribution.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 : public ProbabilityDistribution
59 {
60 public:
61  ITK_DISALLOW_COPY_AND_MOVE(ChiSquareDistribution);
62 
68 
71 
73  itkNewMacro(Self);
74 
78  GetNumberOfParameters() const override
79  {
80  return 1;
81  }
82 
85  double
86  EvaluatePDF(double x) const override;
87 
91  double
92  EvaluatePDF(double x, const ParametersType &) const override;
93 
96  virtual double
97  EvaluatePDF(double x, SizeValueType degreesOfFreedom) const;
98 
101  double
102  EvaluateCDF(double x) const override;
103 
107  double
108  EvaluateCDF(double x, const ParametersType &) const override;
109 
112  virtual double
113  EvaluateCDF(double x, SizeValueType degreesOfFreedom) const;
114 
118  double
119  EvaluateInverseCDF(double p) const override;
120 
125  double
126  EvaluateInverseCDF(double p, const ParametersType &) const override;
127 
131  virtual double
132  EvaluateInverseCDF(double p, SizeValueType degreesOfFreedom) const;
133 
136  virtual void SetDegreesOfFreedom(SizeValueType);
137 
140  virtual SizeValueType
141  GetDegreesOfFreedom() const;
142 
144  bool
145  HasMean() const override
146  {
147  return true;
148  }
149 
151  double
152  GetMean() const override;
153 
155  bool
156  HasVariance() const override
157  {
158  return true;
159  }
160 
162  double
163  GetVariance() const override;
164 
170  static double
171  PDF(double x, const ParametersType &);
172 
177  static double
178  PDF(double x, SizeValueType degreesOfFreedom);
179 
189  static double
190  CDF(double x, const ParametersType &);
191 
200  static double
201  CDF(double x, SizeValueType degreesOfFreedom);
202 
213  static double
214  InverseCDF(double p, const ParametersType &);
215 
226  static double
227  InverseCDF(double p, SizeValueType degreesOfFreedom);
228 
229 protected:
231  ~ChiSquareDistribution() override = default;
232 
233  void
234  PrintSelf(std::ostream & os, Indent indent) const override;
235 }; // end of class
236 } // end of namespace Statistics
237 } // end namespace itk
238 
239 #endif
itk::Statistics::ChiSquareDistribution::HasVariance
bool HasVariance() const override
Definition: itkChiSquareDistribution.h:156
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkProbabilityDistribution.h
itk::Statistics::ChiSquareDistribution::HasMean
bool HasMean() const override
Definition: itkChiSquareDistribution.h:145
itk::Statistics::ProbabilityDistribution
ProbabilityDistribution class defines common interface for statistical distributions (pdfs,...
Definition: itkProbabilityDistribution.h:72
itk::Statistics::ChiSquareDistribution
ChiSquareDistribution class defines the interface for a univariate Chi-Square distribution (pdfs,...
Definition: itkChiSquareDistribution.h:58
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Statistics::ChiSquareDistribution::GetNumberOfParameters
SizeValueType GetNumberOfParameters() const override
Definition: itkChiSquareDistribution.h:78
itkNumericTraits.h
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83