Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save rleonid/86aac2ac1095a927d272 to your computer and use it in GitHub Desktop.
# let n1 = Sampling.normal ~mean:2. ~std:1. () ;;
val n1 : float Oml.Sampling.generator = <fun>
# let n2 = Sampling.normal ~mean:2. ~std:10. () ;;
val n2 : float Oml.Sampling.generator = <fun>
# let data =
Array.init 10000 (fun i -> if i mod 10 = 0 then n2 () else n1 ()) ;;
val data : float array
= [|4.9157; 0.5018; 1.9781; 3.1645; 2.6965; 2.8426; ... |]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment