00001 #pragma ident "$Id: Chi2Distribution.hpp 1409 2008-09-24 16:56:22Z architest $"
00002
00008 #ifndef CHI2DISTRIBUTION_HPP
00009 #define CHI2DISTRIBUTION_HPP
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #include "BaseDistribution.hpp"
00035
00036
00037 namespace gpstk
00038 {
00039
00042
00069 class Chi2Distribution : public BaseDistribution
00070 {
00071 public:
00072
00073
00075 Chi2Distribution() : ndf(2) {};
00076
00077
00084 Chi2Distribution( int n )
00085 { setNDF(n); };
00086
00087
00092 virtual double pdf(double x);
00093
00094
00102 virtual double pdf(double x, int n)
00103 { setNDF(n); return pdf(x); };
00104
00105
00110 virtual double cdf(double x);
00111
00112
00120 virtual double cdf(double x, int n)
00121 { setNDF(n); return cdf(x); };
00122
00123
00129 virtual double Q(double x)
00130 { return ( 1.0 - cdf(x) ); };
00131
00132
00141 virtual double Q(double x, int n)
00142 { return ( 1.0 - cdf(x,n) ); };
00143
00144
00146 virtual double getNDF(void) const
00147 { return ndf; };
00148
00149
00156 virtual Chi2Distribution& setNDF(int n)
00157 throw(InvalidParameter);
00158
00159
00160 private:
00161
00162
00164 int ndf;
00165
00166
00167 };
00168
00170
00171 }
00172 #endif // CHI2DISTRIBUTION_HPP