68 f64 d, delta_d, actual_frequency, expected_frequency;
69 u64 n_observations = 0;
79 for (i = 0; i <
len; i++)
80 n_observations += values[i];
82 expected_frequency = (1.0 / (
f64) len) * (
f64) n_observations;
86 for (i = 0; i <
len; i++)
88 actual_frequency = ((
f64) values[i]);
89 delta_d = ((actual_frequency - expected_frequency)
90 * (actual_frequency - expected_frequency))
sll srl srl sll sra u16x4 i
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.