Module Gsl.Monte

Monte Carlo Integration

High-level interface

type kind =
  1. | PLAIN
  2. | MISER
  3. | VEGAS
val integrate : kind -> Fun.monte_fun -> lo:float array -> up:float array -> int -> Rng.t -> Fun.result

Low-level interface

PLAIN algorithm
type plain_state
val make_plain_state : int -> plain_state
val init_plain : plain_state -> unit
val integrate_plain : Fun.monte_fun -> lo:float array -> up:float array -> int -> Rng.t -> plain_state -> Fun.result
MISER algorithm
type miser_state
type miser_params = {
  1. estimate_frac : float;
  2. min_calls : int;
  3. min_calls_per_bisection : int;
  4. miser_alpha : float;
  5. dither : float;
}
val make_miser_state : int -> miser_state
val init_miser : miser_state -> unit
val integrate_miser : Fun.monte_fun -> lo:float array -> up:float array -> int -> Rng.t -> miser_state -> Fun.result
val get_miser_params : miser_state -> miser_params
val set_miser_params : miser_state -> miser_params -> unit
VEGAS algorithm
type vegas_state
type vegas_info = {
  1. result : float;
  2. sigma : float;
  3. chisq : float;
}
type vegas_mode =
  1. | STRATIFIED
  2. | IMPORTANCE_ONLY
  3. | IMPORTANCE
type vegas_params = {
  1. vegas_alpha : float;
    (*

    1.5

    *)
  2. iterations : int;
    (*

    5

    *)
  3. stage : int;
  4. mode : vegas_mode;
  5. verbose : int;
  6. ostream : Stdlib.out_channel option;
}
val make_vegas_state : int -> vegas_state
val init_vegas : vegas_state -> unit
val integrate_vegas : Fun.monte_fun -> lo:float array -> up:float array -> int -> Rng.t -> vegas_state -> Fun.result
val get_vegas_info : vegas_state -> vegas_info
val get_vegas_params : vegas_state -> vegas_params
val set_vegas_params : vegas_state -> vegas_params -> unit