Skip to content

Instantly share code, notes, and snippets.

@rleonid
Created August 6, 2015 20:53
Show Gist options
  • Select an option

  • Save rleonid/a86e0c00469c8ccb293c to your computer and use it in GitHub Desktop.

Select an option

Save rleonid/a86e0c00469c8ccb293c to your computer and use it in GitHub Desktop.
# let data_skew ftf =
Array.init 10000 (fun i -> if i mod ftf = 0 then n2 () else n1())
|> Descriptive.unbiased_summary
|> fun s -> s.Descriptive.skew
|> snd ;;
val data_skew : int -> Oml.Descriptive.skew_classification = <fun>
# let count_big_skew =
Array.fold_left (fun c s ->
if s = `Positive || s = `Negative then c + 1 else c) 0 ;;
val count_big_skew : _[> `Negative | `Positive ] array -> int = <fun>
# Array.init 100 (fun _ -> data_skew 10) |> count_big_skew ;;
- : int = 86
# Array.init 100 (fun _ -> data_skew 2) |> count_big_skew ;;
- : int = 33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment