46 if ((s == NULL) || (s->
n == 0))
56 if ((s == NULL) || (s->
n < 2))
58 return sqrt (fabs ((s->
st2 - s->
st * s->
st / s->
n) / (s->
n - 1)));
65 if ((s == NULL) || (s->
n == 0))
75 if ((s == NULL) || (s->
n == 0))
85 if ((s == NULL) || (s->
n == 0))
97 memset (s, 0,
sizeof (*s));
125 if ((s != NULL) && (s->
n > 1)) {
128 printf (
"%s <--", c);
130 printf (
" Mean Value : %9.4f\n",
zeKMean (s));
131 printf (
" Std. Deviation : %9.4f\n",
zeKStdDev (s));
132 printf (
" Confidence (%4.2f) : %9.4f\n", p,
134 printf (
" Notes : %9d\n", s->
n);
148 #define M_PI 3.14159265358979323846 151 #define SQRT2PI 2.50662827479 153 #define sqr(x) ((x)*(x)) 160 static point *p = NULL;
170 init_table (
int nint,
double nmax)
174 double dx = nmax / nint;
177 if ((p = (
point *) malloc ((nint + 1) *
sizeof (
point))) == NULL)
180 memset (p, 0, (nint + 1) *
sizeof (
point));
184 for (i = 1; i < nint + 1; i++) {
186 y += dx * (fn (x) + fn (x - dx)) / 2;
194 static int NINT = 1000;
195 static double NMAX = 10.;
197 #define sign(x) (((x) > 0.) ? 1 : (((x) < 0.) ? -1 : 0)) 202 double dx = NMAX / NINT;
209 if ((p == NULL) && ((init_table (NINT, NMAX)) !=
OK)) {
210 printf (
"Erreur pendant creation de matrice normale\n");
218 return (s * p[NINT].y);
237 (p[i].y + (x - p[i].x) * (p[j].y - p[i].y) / (p[j].x - p[i].x)));
245 return (0.5 + f (x));
248 #if !defined(HAVE_ERF) 256 #if !defined(HAVE_ERFC) 260 return (1 - 2 * f (x));
317 if ((p == NULL) && ((init_table (NINT, NMAX)) !=
OK)) {
318 printf (
"Erreur pendant creation de matrice normale\n");
331 return p[i].
x + (y - p[i].
y) * (p[j].x - p[i].x) / (p[j].
y - p[i].
y);
337 if ((y > 1.) || (y < 0.))
341 return (finv (y - 0.5));
342 return (-finv (0.5 - y));
348 if ((y > 1.) || (y < -1.))
351 return (
sign (y) * finv (fabs (y / 2)));
357 if ((y > 2.) || (y < 0.))
360 return (
erfi (1. - y));
367 if ((p < 0.) || (p > 1.))
370 return (stddev *
erfi (p) / sqrt ((
double) n));
long zeKCount(kstats_T *s)
double confidence_interval(double p, double stddev, int n)
void zeKStatsUpdate(kstats_T *s, double t)
double zeKMean(kstats_T *s)
void print_inference(kstats_T *, double, char *)
void zeKStatsReset(kstats_T *s)
double zeKMax(kstats_T *s)
double zeKStdDev(kstats_T *s)
double zeKMin(kstats_T *s)