[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gsl] Mean of values returned by gsl_ran_exponential is much greater
From: |
Abhishek Jain |
Subject: |
[Bug-gsl] Mean of values returned by gsl_ran_exponential is much greater than expected mean |
Date: |
Mon, 17 Dec 2018 19:21:14 +0530 |
The version number of GSL:
2.1+dfsg-2
The hardware and operating system:
Ubuntu 16.04.4 LTS
The compiler used, including version number and compilation options:
gcc 5.4.0
A description of the bug behavior:
For a given mu, the average of the values returned by gsl_ran_exponential
does not match the given mu.
A short program which exercises the bug:
Attached is a sample program which takes as input the number of iterations
and the average to achieve. The program compares the average sleep time
returned by the Exponential distribution (gsl_ran_exponential) and the
Poisson distribution (gsl_ran_poisson). Some conversion has been applied in
the code to keep the values as multiples of 10
Sample output with randomly chosen mean = 117 and different number of
iterations is below:
address@hidden:~$ ./rand 10 117 (./rand <number of iterations> <mean to
achieve>)
max_poi = [130], min_poi = [90] avg_poi = [112.000]
max_exp = [970], min_exp = [20] avg_exp = [226.000]
address@hidden:~$ ./rand 20 117
max_poi = [130], min_poi = [90] avg_poi = [112.000]
max_exp = [970], min_exp = [20] avg_exp = [153.000]
address@hidden:~$ ./rand 50 117
max_poi = [140], min_poi = [90] avg_poi = [115.000]
max_exp = [970], min_exp = [0] avg_exp = [110.000]
address@hidden:~$ ./rand 500 117
max_poi = [150], min_poi = [80] avg_poi = [117.000]
max_exp = [1230], min_exp = [0] avg_exp = [118.000]
As seen in the above results, the mean of all the values returned by
gsl_ran_exponential (226, 153) is higher than the desired mean of 110 for
num iterations les than 50
rand.c
Description: Binary data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gsl] Mean of values returned by gsl_ran_exponential is much greater than expected mean,
Abhishek Jain <=