00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkChiSquareDistribution_h
00018 #define __itkChiSquareDistribution_h
00019
00020 #include "itkProbabilityDistribution.h"
00021 #include "itkNumericTraits.h"
00022
00023 namespace itk {
00024 namespace Statistics {
00025
00054 class ITK_EXPORT ChiSquareDistribution :
00055 public ProbabilityDistribution
00056 {
00057 public:
00059 typedef ChiSquareDistribution Self;
00060 typedef ProbabilityDistribution Superclass;
00061 typedef SmartPointer<Self> Pointer;
00062 typedef SmartPointer<const Self> ConstPointer;
00063
00065 itkTypeMacro(ChiSquareDistribution, ProbabilityDistribution);
00066
00068 itkNewMacro(Self);
00069
00072 virtual unsigned long GetNumberOfParameters() const { return 1; }
00073
00076 virtual double EvaluatePDF(double x) const;
00077
00081 virtual double EvaluatePDF(double x, const ParametersType&) const;
00082
00085 virtual double EvaluatePDF(double x, long degreesOfFreedom) const;
00086
00089 virtual double EvaluateCDF(double x) const;
00090
00094 virtual double EvaluateCDF(double x, const ParametersType&) const;
00095
00098 virtual double EvaluateCDF(double x, long degreesOfFreedom) const;
00099
00103 virtual double EvaluateInverseCDF(double p) const;
00104
00109 virtual double EvaluateInverseCDF(double p, const ParametersType&) const;
00110
00114 virtual double EvaluateInverseCDF(double p, long degreesOfFreedom) const;
00115
00118 virtual void SetDegreesOfFreedom(long);
00119
00122 virtual long GetDegreesOfFreedom() const;
00123
00125 virtual bool HasMean() const { return true; }
00126
00128 virtual double GetMean() const;
00129
00131 virtual bool HasVariance() const { return true; }
00132
00134 virtual double GetVariance() const;
00135
00136
00142 static double PDF(double x, const ParametersType&);
00143
00148 static double PDF(double x, long degreesOfFreedom);
00149
00159 static double CDF(double x, const ParametersType&);
00160
00169 static double CDF(double x, long degreesOfFreedom);
00170
00181 static double InverseCDF(double p, const ParametersType&);
00182
00193 static double InverseCDF(double p, long degreesOfFreedom);
00194
00195 protected:
00196 ChiSquareDistribution(void);
00197 virtual ~ChiSquareDistribution(void) {}
00198
00199 void PrintSelf(std::ostream& os, Indent indent) const;
00200
00201 private:
00202 ChiSquareDistribution(const Self&);
00203 void operator=(const Self&);
00204
00205 };
00206
00207 }
00208 }
00209
00210 #endif
00211