File: multifit-data.ml

package info (click to toggle)
ocamlgsl 0.3.5-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,444 kB
  • ctags: 2,901
  • sloc: ml: 7,956; ansic: 6,796; makefile: 303; sh: 87; awk: 13
file content (15 lines) | stat: -rw-r--r-- 330 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
let _ = 
  Gsl_error.init () ;
  Gsl_rng.env_setup ()

let rng = Gsl_rng.make (Gsl_rng.default ())

let _ = 
  let x = ref 0.1 in
  while !x < 2. do
    let y0 = exp !x in
    let sigma = 0.1 *. y0 in
    let dy = Gsl_randist.gaussian rng ~sigma in
    Printf.printf "%.1f %g %g\n" !x (y0 +. dy) sigma ;
    x := !x +. 0.1
  done