Home | History | Annotate | Download | only in tests

Lines Matching refs:nu

37 /* Given nu and chisqp, compute probability that chisq > chisqp.  This uses,
40 * Q(nu,chisqp) =
41 * erfc( (3/2)*sqrt(nu) * ( cbrt(chisqp/nu) - 1 + 2/(9*nu) ) ) / 2
43 * which is valid for nu > 30. This is the basis for the formula in Knuth,
47 chisq_prob (mpfr_ptr q, long nu, mpfr_ptr chisqp)
55 mpfr_div_si (q, chisqp, nu, rnd); /* chisqp/nu */
56 mpfr_cbrt (q, q, rnd); /* (chisqp/nu)^(1/3) */
57 mpfr_sub_ui (q, q, 1, rnd); /* (chisqp/nu)^(1/3) - 1 */
59 mpfr_div_si (t, t, 9*nu, rnd); /* 2/(9*nu) */
60 mpfr_add (q, q, t, rnd); /* (chisqp/nu)^(1/3) - 1 + 2/(9*nu) */
61 mpfr_sqrt_ui (t, nu, rnd); /* sqrt(nu) */
62 mpfr_mul_d (t, t, 1.5, rnd); /* (3/2)*sqrt(nu) */
85 test_nrandom_chisq_cont (long num, mpfr_prec_t prec, int nu,
99 counts = (long *) tests_allocate ((nu + 1) * sizeof (long));
100 for (i = 0; i <= nu; i++)
103 /* a and b are bounds of nu equally spaced bins. Set dx = (b-a)/nu */
108 mpfr_div_si (dx, dx, nu, rnd);
122 ++counts[i >= 0 && i < nu ? i : nu];
129 for (i = 0; i <= nu; ++i)
131 if (i < nu)
138 mpfr_sub (pa, ps, pa, rnd); /* prob for last bin, i = nu */
150 chisq_prob (t, nu, t);
154 printf ("num = %ld, equal bins in [%.2f, %.2f], nu = %d: chisq = %.2f\n",
155 num, xmin, xmax, nu, chisq);
160 tests_free (counts, (nu + 1) * sizeof (long));
209 int i, inexact, nu;
229 nu = 2 * (seqmax - seqmin + 1) + 2 - 1;
230 counts = (long *) tests_allocate ((nu + 1) * sizeof (long));
231 for (i = 0; i <= nu; i++)
247 nu];
259 for (i = 0; i <= nu; ++i)
261 if (i < nu)
280 chisq_prob (t, nu, t);
285 "nu = %d: chisq = %.2f\n", num, prec, xmin, xmax, nu, chisq);
290 tests_free (counts, (nu + 1) * sizeof (long));