Evidence.VarObservation variables.
This module provides a type to describe and type observation variables. Essentially, an observation variable is a named projection function.
module Type : sig ... endVariable types.
v ?doc ?pp name type' proj an observation variable with
name the name or identifier of the variable.type' the type of the variable.proj the projection of the variable.pp a formatter for the variable, defaults to Type.value_pplabel a label for the variable used in graphical renderingdoc a documentation string for the variableWarning. For float types, if you want nan values to be treated by Dataset as missing values, you need to use Float and not Any or Ordinal.
Note. Variables have a notion of identity, if you create two variables with the same parameters they will not be deemed equal by equal.
bool name proj is v name Bool proj.
int name proj is v name Int proj.
float name proj is v name Float proj.
val nominal :
?doc:string ->
?label:string ->
?pp:string fmt ->
name ->
('o -> string) ->
('o, string) tnominal name proj is v name Nominal.
val ordinal :
?doc:string ->
?label:string ->
?pp:'a fmt ->
name ->
('a -> 'a -> int) ->
('o -> 'a) ->
('o, 'a) tordinal name compare proj is v name (Ordinal compare) proj.
any name proj is v name Any proj.
const name type' v is v name type' (Fun.const v).
val doc : ('o, 'a) t -> stringdoc var is the documentation string of var.
val label : ('o, 'a) t -> stringlabel var is the label of var.
val proj : ('o, 'a) t -> 'o -> 'aproj var is the projection of var.
alter ?doc ?label ?name ?pp var is var with the given parameters. The resulting variable is equal to var.
val map :
?doc:string ->
?label:string ->
?pp:'b fmt ->
('a -> 'b) ->
('o, 'a) t ->
name ->
'b type' ->
('o, 'b) tmap f var name type' is a new variable derived via f from var.
val equal_value : ('o, 'a) t -> 'a -> 'a -> boolequal_value var is a comparison function for the values of var. nan values are deemed equal.
val compare_value : ('o, 'a) t -> 'a -> 'a -> intcompare_value var is a comparison function for values of var. nan values are deemed equal and lower than any other float value.
val min_value : ('o, 'a) t -> 'a -> 'a -> 'amin_value var is a function that determines the minimum for values of var. On Float variables this uses Float.min_num which treats nans as missing values.
val max_value : ('o, 'a) t -> 'a -> 'a -> 'amin_value var is a function that determines the maximum for values of var. On Float variables this uses Float.max_num which treats nans as missing values.
See also Obs.
The type for variable order.
val order : 'o order list -> 'o -> 'o -> intorder vars is the lexicographic ascending or descending order of variables vars of observations. Raises Invalid_argument if vars is empty.
val is_na : ('o, float) t -> 'o -> boolis_na var o is Float.is_nan (proj var o).
val between : 'a -> 'a -> ('o, 'a) t -> 'o -> boolbetween min max var o is true iff proj var o is in the range [min;max]. This uses compare_value.
val equal_obs : ('o, 'a) t -> 'o -> 'o -> boolequal_obs var tests for equality on variable var. nan values are deemed equal.
val compare_obs : ('o, 'a) t -> 'o -> 'o -> intcompare_obs var tests for equality on variable var. nan values are deemed equal.
val min_obs : ('o, 'a) t -> 'o -> 'o -> 'omin_obs var o0 o1 is the observation with the minimal var value (either is returned on ties). On Float variables this uses Float.min_num which treats nans as missing values.
val max_obs : ('o, 'a) t -> 'o -> 'o -> 'omax_obs var o0 o1 is the observation with the maximal var value (either is returned on ties). On Float variables this uses Float.max_num which treats nans as missing values.
equal var0 var1 is true iff var0 and var1 is the same variable.
compare is a total order on variables compatible with equal.
for_var_count var are two variables to access the result of a Dataset.Var.count dataset.
val cumsum : (float, float) tcumsum is the variable for Data.Var.cum_sum results.
module Prod : sig ... endVariable products.