Module Measure.Statistic.Chi_square


module Chi_square: sig .. end
The chi square statistical test. Translated from numerical recipe in C.

val log_gamma : float -> float
Returns ln(Gamma(x)) for x> 0. Could be tabulated.
exception Converged
val gamma_0_x : float -> float -> float

gamma_0_x (degrees_of_freedom / 2) (chi2 / 2) is the probability that X > chi2 when X follows a chi squared law.
val gamma_x_infty : float -> float -> float
val gamma_p : float -> float -> float
Returns the incomplete gamma function P(a,x).
val gamma_complement : float -> float -> float
Returns the complement of the incomplete gamma function, ie 1 - P(a,x).
val chi_squared : int array -> int -> int array -> int -> float * int
chi_squared distrib1 distrib2 A small value of the returned probability value indicates that the two distributions are likely to be different.
Assumes that no normalization has been done (the number of samples need not to be equal), so the number of degrees of freedom is Array.length distrib1.
val chi_square_critical_value : float -> int -> float
val chi_square_table : float -> int -> float
let cs = chi_square_table significance_level initialize a small table. Then cs degrees_of_freedom extends the table if needed.
val close : float -> int array -> int -> int array -> int -> bool
call let test = close significance_level to compute the table (which will be extended as needed). Then test distrib1 nb_samples1 distrib2 nb_samples2 tells wheter both distributions are close.