4 #include "local_proto.h"
9 double mean = 0.0, sdx = 0.0, sum3 = 0.0, *v;
12 k = rint(4.0 * pow(0.75 * (n - 1.0) * (n - 1.0), 0.2));
14 while ((
double)(n / k) < 5.0)
17 if ((f = (
int *)calloc(k,
sizeof(
int))) ==
NULL) {
18 fprintf(stderr,
"Memory error in Cdhc_chi_square\n");
21 if ((v = (
double *)
malloc((k + 1) *
sizeof(
double))) ==
NULL) {
22 fprintf(stderr,
"Memory error in Cdhc_chi_square\n");
26 for (i = 0; i < n; ++i) {
30 sdx = sqrt((n * sdx -
mean *
mean) / (n * (n - 1.0)));
34 for (i = 1; i < k; ++i)
39 for (i = 0; i < n; ++i) {
42 if (
x[i] > v[j] &&
x[i] <= v[j + 1]) {
50 for (i = 0; i < k; ++i)
53 y[0] = sum3 * k / n - n;
54 y[1] = (double)k - 3.0;
57 fprintf(stdout,
" TEST12 CS(N) =%10.4f DOF =%10.4f\n", y[0], y[1]);
double * Cdhc_chi_square(double *x, int n)
double Cdhc_xinormal(double)
float mean(IClass_statistics *statistics, int band)
Helper function for computing mean.