Vz.Stat
Data statistics.
Stat
summarizes data with statistics.
type ('a, 'b) t = ('a, 'b) stat
The type for a statistic of type 'b
on data of type 'a
.
add s v
is the statistic s
with value v
added to the data.
val value : ('a, 'b) stat -> 'b
value s
is the value of statistic s
.
val count : ('a, float) stat
count s
is the integral number of values in the data.
val min : ('a -> float) -> ('a, float) stat
min f
is the minimum value of f
on the data.
val max : ('a -> float) -> ('a, float) stat
max f
is the maximum value of f
on the data.
val range : ('a -> float) -> ('a, float * float) stat
range f
is the range of f
on the data, equivalent to t2 (min f) (max f)
.
val range_d : ?cmp:('b -> 'b -> int) -> ('a -> 'b) -> ('a, 'b list) stat
range_d cmp f
is the discrete range of f
, the set of values returned by f
on the data. cmp
is used to compare the values (defaults to Pervasives.compare
).
val sum : ?nan:bool -> ('a -> float) -> ('a, float) stat
sum nan f
is the sum of the values returned by f
on the data. If nan
is false
(default), nan
values are ignored.
val mean : ?nan:bool -> ('a -> float) -> ('a, float) stat
mean nan f
is the mean of the values returned by f
on the data. If nan
is false
(default), nan
values are ignored.
val mean_var :
?nan:bool ->
?pop:bool ->
('a -> float) ->
('a, float * float) stat
mean_var nan pop f
is the mean and unbiased sample variance of the values returned by f
on the sample data. If pop
is true
(defaults to false
), the population variance (biased sample variance) is computed. If nan
is false
(default), nan
values are ignored.
val fold : ('b -> 'a -> 'b) -> 'b -> ('a, 'b) stat
fold f acc
is f
folded on the the data starting with acc
.
t2 s1 s2
is the combined statistics of s1
and s2
on the data.
t3 s1 s2 s3
is the combined statistics of s1
, s2
and s3
on the data.