Module BC_Stats


module BC_Stats: sig  end
Statistical functions
Author(s): Hideo Bannai, Yoshinori Tamada

val list_mean_aux : 'a list -> 'b -> ('b -> 'a -> 'b) -> ('b -> float -> 'c) -> 'c
auxiliary function for list mean list -> initial value of sum, addition function, division function (always divide by a float value)
val int_list_mean : int list -> float
average of a list of ints
val float_list_mean : float list -> float
average of a list of floats
val array_mean_aux : 'a array -> 'b -> ('b -> 'a -> 'b) -> ('b -> float -> 'c) -> 'c
auxiliary function for array mean array -> initial value of sum, addition function, division function (always divide by a float value)
val int_array_mean : int array -> float
average of an array of ints
val float_array_mean : float array -> float
average of an array of floats
val list_sum_aux : 'a list -> 'b -> ('b -> 'a -> 'b) -> 'b
auxiliary function for list sum
val int_list_sum : int list -> int
sum of an list of ints
val float_list_sum : float list -> float
sum of an list of floats
val array_sum_aux : 'a array -> 'b -> ('b -> 'a -> 'b) -> 'b
sum for array
val int_array_sum : int array -> int
sum of an array of ints
val float_array_sum : float array -> float
sum of an array of floats

type 'a median =
| S of 'a
| D of 'a * 'a
the type for a median - two if the # of data is even

val list_median_aux : 'a list -> ('a -> 'a -> int) -> 'a median
returns the median, w/ respect to a comparison function, of a list
val array_median_aux : 'a array -> ('a -> 'a -> int) -> 'a median
returns the median, w/ respect to a comparison function, of an array
val list_median : 'a list -> 'a median
returns the median, w/ respect to compare, of a list.
val array_median : 'a array -> 'a median
returns the median, w/ respect to compare, of an array
val list_variance : 'a list ->
'b -> ('b -> 'a -> 'b) -> ('a -> 'a -> 'a) -> ('b -> float) -> float
helper function for calculating the variance of values in a list
val int_list_variance : int list -> float
the variance of values in a list of ints
val float_list_variance : float list -> float
the variance of values in a list of floats
val list_std_deviation : 'a list ->
'b -> ('b -> 'a -> 'b) -> ('a -> 'a -> 'a) -> ('b -> float) -> float
helper function for calculating the standard deviation of values in a list
val int_list_std_deviation : int list -> float
standard deviation of values in a list of ints
val float_list_std_deviation : float list -> float
standard deviation of values in a list of floats
val int_array_variance : int array -> float
the variance of values in the array.
val float_array_variance : float array -> float
the variance of values in the array.
val group : 'a list -> int -> ('a -> float) -> ((float * float) * 'a list) array
group lst n f. experimental function for grouping a list of data into blocks of regions of equal size. f gives a floating point value for each element in the list, which is the value which is subject to the division. Returns an array of (float * float) * 'a list where the pair of floats represents the interval that the elements in the list were divided to.
val group_setsz : 'a list -> int -> ('a -> 'b) -> 'a list list
group_setsz lst n f. experimental function for grouping a list of data into groups of atleast n elements. Elements of the same value are guaranteed to be in the same group.
val freq_int_list : int list -> int -> int -> int -> int array -> unit
returns frequency list of a given int list. Note that this function si experimental implementation. The interface of this function might be changed in the future.
val show_histogram : int list -> int -> int -> int -> unit
shows a histogram. Note that this function is experimental implementation. The interface of this function might be changed in the future.
val mcc : tp:int -> tn:int -> fp:int -> fn:int -> float
Matthews correlation coefficient

tp : number of true positives
tn : number of true negatives
fp : number of false positives
fn : number of false negatives


Random value generators that are distributeted under the popular statistical distributions


val bernoulli : float -> int
bernoulli p returns a random integer value either 0 or 1, that has Bernoulli distribution with success probablitiy p.
val bern : float -> int
bern p is the function same as bernoulli p.
val binomial : int -> float -> int
binomial n p returns a random integer value that has Binomial distrituion with index n and success probability p.
val neg_binomial : int -> float -> int
neg_binomial r p returns a random integer value that has Negative Binomial distribution with index r and success probability p.
val snormal : unit -> float
snormal () returns a random value based on standard normal distribution (i.e. mean=0, variance=1).
val normal : float -> float -> float
normal m v returns a normal random value N(m, v^2)
val qf : int -> int -> float -> float
qf v1 v2 f returns cumulative probablitiy of F distribution with digree of freedom v1, v2.