2 #ifndef vnl_chi_squared_hxx_ 3 #define vnl_chi_squared_hxx_ 16 double cdf, chisqr = chisq;
17 v3p_netlib_dchscdf_(&chisqr,&dof,&cdf);
32 for (
int i=0; i<n; ++i) {
37 for (
int i=0; i<n; ++i)
39 double a = double(A[i])/sumA;
40 double b = double(B[i])/sumB;
47 for (
int i=0; i<n; ++i)
49 double tmp = A[i] - B[i];
72 for (
int i=0; i<n; ++i) {
77 for (
int i=0; i<n; ++i)
79 double a = double(A[i])/sumA;
80 double b = double(B[i])/sumB;
82 sum += tmp*tmp/(a + b);
87 for (
int i=0; i<n; ++i)
89 double tmp = A[i] - B[i];
90 sum += tmp*tmp/(A[i] + B[i]);
97 #undef VNL_CHI_SQUARED_INSTANTIATE 98 #define VNL_CHI_SQUARED_INSTANTIATE(T) \ 99 template VNL_ALGO_EXPORT double vnl_chi_squared_cumulative (T chisq, long dof); \ 100 template VNL_ALGO_EXPORT double vnl_chi_squared_statistic_1 (T const *, T const *, int, bool); \ 101 template VNL_ALGO_EXPORT double vnl_chi_squared_statistic_2 (T const *, T const *, int, bool); \ 102 template VNL_ALGO_EXPORT double vnl_chi_squared_statistic_12(T const *, T const *, int, bool) 104 #endif // vnl_chi_squared_hxx_ double vnl_chi_squared_statistic_1(T const *A, T const *B, int n, bool normalize)
Name space for various chi-squared distribution functions.
double vnl_chi_squared_statistic_12(T const *A, T const *B, int n, bool normalize)
Data normalize(const vnl_bignum &b1, const vnl_bignum &b2, vnl_bignum &u, vnl_bignum &v)
normalize two vnl_bignums.
Declare in a central place the list of symbols from netlib.
double vnl_chi_squared_cumulative(T chisq, long dof)
Compute cumulative distribution function value for chi-squared distribution.
Name space for various (mostly templated) chi-squared distribution functions.
double vnl_chi_squared_statistic_2(T const *A, T const *B, int n, bool normalize)