rleonid / oml

OCaml Math Library
Apache License 2.0
119 stars 9 forks source link

Error in module Uncategorised #188

Closed vd1 closed 7 years ago

vd1 commented 7 years ago

Is the API documentation wrong?

This seems to work fine:

# Statistics.Distributions.normal_cdf 1.0;; 
- : float = 0.841344746068542926

but this not:

# Uncategorized.Functions.gamma 3.0;;
Error: Unbound module Uncategorized.Functions

actually there are plenty of examples which do not work

# Statistics.Descriptive.mean (Array.of_list m);;  
- : float = 0.481834724788050506
# Statistics.Descriptive.median (Array.of_list m);;
- : float = 0.484381908083384605
# Statistics.Descriptive.var (Array.of_list m);;   
- : float = 0.0834655321254655
# Statistics.Descriptive.unbiased_var (Array.of_list m);;
Error: Unbound value Statistics.Descriptive.unbiased_var
# Statistics.Descriptive.population_var 0.5 (Array.of_list m);;
Error: Unbound value Statistics.Descriptive.population_var
rleonid commented 7 years ago

Yes, the API and documentation have strayed.

I think that these are issues stemming from the faulty 0.0.6 release. Since I cannot replicate them on the pending 0.0.7 version would it be ok if I make sure that they are addressed with that release?

vd1 commented 7 years ago

sure, thanks.

rleonid commented 7 years ago

@vd1 I've released 0.0.7 and updated the online documentation (http://www.hammerlab.org/oml/). In utop you should see

# #show_module Oml.Statistics.Descriptive ;;
module
Descriptive :
sig
    val mean : float array -> float
    val median : float array -> float
    val var : ?population_mean:float -> ?biased:bool -> float array -> float
    val sd : ?population_mean:float -> ?biased:bool -> float array -> float
    val ad :
      ?population:float -> ?center:[ `Mean | `Median ] -> float array -> float
    val covariance :
      ?population_means:float * float ->
      ?biased:bool -> float array -> float array -> float
    val correlation : float array -> float array -> float
    val autocorrelation : int -> float array -> float
    val moment : int -> float array -> float
    val skew : ?biased:bool -> float array -> float
    val kurtosis : ?biased:bool -> float array -> float
    val var_standard_error : float array -> float
    val skew_standard_error : float array -> float
    val kurtosis_standard_error : float array -> float
    val var_statistic : float array -> float
    val skew_statistic : float array -> float
    val kurtosis_statistic : float array -> float
    type skew_classification =
        [ `Negative
        | `Normal
        | `Positive
        | `Slightly_negative
        | `Slightly_positive ]
    val classify_skew : float array -> skew_classification
    type kurtosis_classification =
        [ `Fat | `Normal | `Skinny | `Slightly_fat | `Slightly_skinny ]
    val classify_kurtosis : float array -> kurtosis_classification
    type summary = {
      size : int;
      min : float;
      max : float;
      mean : float;
      std : float;
      var : float;
      skew : float * skew_classification;
      kurtosis : float * kurtosis_classification;
    }
    val summary : ?biased:bool -> float array -> summary
    val histogram :
      [ `Buckets of int | `Specific of float array | `Width of float ] ->
      float array -> (float * int) array
    val geometric_mean : float array -> float
    val harmonic_mean : float array -> float
    val spearman : float array -> float array -> float
    val cosine : float array -> float array -> float
  end

I hope that you find it useful.

vd1 commented 7 years ago

awesome thanks!