Stats.Emp
Empirical distributions.
type 'a t = 'a Stats_intf.emp
'a t
is the type of empirical distributions over 'a
.
val of_generative :
nsamples:int ->
('s, 'a) Stats_intf.gen ->
('s, 'a t) Stats_intf.gen
of_generative ~nsamples gen
transforms the generative distribution gen
into a random empirical distribution. Each empirical distribution is obtained by taking nsamples
samples from gen
.
val of_raw_data : 'a array -> 'a t
of_raw_data array
creates an empirical distribution matching the contents of array
.
val to_raw_data : 'a t -> [> `Empirical of 'a array ]
to_raw_data dist
returns an array containing the empirical data.
val truncate :
(module Basic_structures.Basic_intf.Ordered with type t = 'elt) ->
'elt t ->
float ->
'elt t
truncate ord dist p
discards the last 1-p percentiles of dist
. The underlying data is totally ordered by ord
.
val quantile :
(module Basic_structures.Basic_intf.Ordered with type t = 'elt) ->
'elt t ->
float ->
'elt
quantile ord dist p
computes the p
th percentile of dist
. The underlying data is totally ordered by ord
.
remove_outliers ~nsigmas dist
discards elements which are above nsigmas
(empirical) standard deviations above or below the (empirical) mean.
module type Empirical_statistics = sig ... end
The module type of empirical statistics.
module Float : Empirical_statistics with type r = float
Empirical statistics over floats.
module Rational : Empirical_statistics with type r = Q.t
Empirical statistics over rationals.