package prbnmcn-stats

  1. Overview
  2. Docs

Empirical distributions.

Empirical distributions.

type 'a t = 'a Stats_intf.emp

'a t is the type of empirical distributions over 'a.

Transformers

val map : ('a -> 'b) -> 'a t -> 'b t

map f dist maps the function f on dist.

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.

Statistics

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 pth percentile of dist. The underlying data is totally ordered by ord.

val remove_outliers : nsigmas:float -> float t -> float t

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.

OCaml

Innovation. Community. Security.