[gnumeric] Fix confidence interval in simulation output. [#607970]
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: svn-commits-list gnome org
- Cc: 
- Subject: [gnumeric] Fix confidence interval in simulation output. [#607970]
- Date: Tue, 26 Jan 2010 00:40:39 +0000 (UTC)
commit ca4db011a26ed9a614eaa6cecef17b85126ebc3b
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Mon Jan 25 17:39:18 2010 -0700
    Fix confidence interval in simulation output. [#607970]
    
    2010-01-25 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* simulation.c (create_stats): fix length calculation for the
    	  confidence interval
 NEWS                   |    3 ++-
 src/tools/ChangeLog    |    5 +++++
 src/tools/simulation.c |    3 ++-
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 6560a40..48009e0 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,8 @@ Gnumeric 1.9.19
 
 Andreas:
 	* Fix ODF contour/surface plot confusion. [#607631]
-	* Include compatibility info in the gnumeric manual
+	* Include compatibility info in the gnumeric manual.
+	* Fix confidence interval in simulation output. [#607970]
 
 Morten:
 	* Fix TRIMMEAN border case.  [#607562]
diff --git a/src/tools/ChangeLog b/src/tools/ChangeLog
index 635fe1a..a0b21bd 100644
--- a/src/tools/ChangeLog
+++ b/src/tools/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-25 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* simulation.c (create_stats): fix length calculation for the 
+	  confidence interval
+
 2010-01-19  Morten Welinder <terra gnome org>
 
 	* Release 1.9.18
diff --git a/src/tools/simulation.c b/src/tools/simulation.c
index 21b7f42..33386f0 100644
--- a/src/tools/simulation.c
+++ b/src/tools/simulation.c
@@ -212,7 +212,8 @@ create_stats (simulation_t *sim, gnm_float **outputs, simstats_t *stats)
 		stats->range[i] = stats->max[i] - stats->min[i];
 
 		/* Confidence (95%) */
-		stats->confidence[i] = -qnorm (0.05, 0, 1, TRUE, FALSE)
+		stats->confidence[i] = 2 * qt (0.025, sim->n_iterations - 1, 
+					       FALSE, FALSE)
 			* (stats->stddev[i] / gnm_sqrt (sim->n_iterations));
 
 		/* Lower Confidence (95%) */
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]