After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 607970 - Confidence Level Calculation in simulation tool maybe wrong
Confidence Level Calculation in simulation tool maybe wrong
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Analytics
1.9.x
Other Linux
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-01-24 21:00 UTC by uabear05
Modified: 2010-01-26 00:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Forumula correction in confidence level in simulation tool (12.29 KB, text/x-csrc)
2010-01-24 21:00 UTC, uabear05
Details

Description uabear05 2010-01-24 21:00:36 UTC
Created attachment 152179 [details]
Forumula correction in confidence level in simulation tool

In the original source code for the Confidence Level Calculation in the simulation tool, the calculation formula is -qnorm(alpha,mu,sigma,True,False).... However alpha should be replaced by alpha/2, i.e.:

CONFIDENCE(alpha, sigma, n) = NORMSINV(1 – alpha/2) * sigma / SQRT(n) 
=r.qnorm(1 – alpha/2,0,1,TRUE,FALSE) * sigma / SQRT(n)

source http://support.microsoft.com/kb/828124

For example:
confidence(0.05,15,50)
=normsinv(1-0.05/2)*15/sqrt(50)
=r.qnorm(1-0.05/2,0,1,TRUE,FALSE)*15/sqrt(50)
=4.15771147304903

or

=-qnorm(0.05/2,0,1,TRUE,FALSE)*15/sqrt(50)
=4.15771147304903

Hope this would be helpful.

See attached file simulation1.c
Comment 1 Andreas J. Guelzow 2010-01-25 14:43:13 UTC
Yes, the confidence interval is definitely not right. The suggested changes do not go quite far enough. I think we should be using the t-distribution rather than the normal distribution.
Comment 2 Andreas J. Guelzow 2010-01-26 00:23:33 UTC
There is more wrong with this: confidence[i] should be the length of the interval, so a factor of 2 is missing. Note that we divide it by 2 when we add it to the point estimate to obtain the upper and lower bounds.
Comment 3 Andreas J. Guelzow 2010-01-26 00:42:52 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

Note that I assume that confidence[i] should be the length of the
interval since it is used that way in the following calculation of the min and max. One could easily justify that "confidence" should only be half of that, corresponding to the CONFIDENCE function, but then we would also need to change the calculation of the lower and upper limits for the CI.