File: multifit_data_ex.ml

package info (click to toggle)
ocamlgsl 1.19.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,628 kB
  • ctags: 2,812
  • sloc: ml: 17,194; ansic: 7,445; makefile: 24
file content (17 lines) | stat: -rw-r--r-- 320 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
open Gsl

let _ = 
  Error.init () ;
  Rng.env_setup ()

let rng = Rng.make (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 = Randist.gaussian rng ~sigma in
    Printf.printf "%.1f %g %g\n" !x (y0 +. dy) sigma ;
    x := !x +. 0.1
  done