67 f64 d, delta_d, actual_frequency, expected_frequency;
68 u64 n_observations = 0;
78 for (i = 0; i <
len; i++)
79 n_observations += values[i];
81 expected_frequency = (1.0 / (
f64) len) * (
f64) n_observations;
85 for (i = 0; i <
len; i++)
87 actual_frequency = ((
f64) values[i]);
88 delta_d = ((actual_frequency - expected_frequency)
89 * (actual_frequency - expected_frequency))
u32 standalone_random_default_seed
Default random seed for standalone version of library.
f64 clib_chisquare(u64 *values)
Compute the X2 test statistic for a vector of counts.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Linear Congruential Random Number Generator.