bugGNU Scientific Library - Bugs: bug #24510, Negative chi squared value in vegas


You are not allowed to post comments on this tracker with your current authentification level.

bug #24510: Negative chi squared value in vegas

Submitted by:  -Deleted Account- <bjg>
Submitted on:  Thu Oct 9 19:25:40 2008  
Category: Runtime errorSeverity: 3 - Normal
Operating System: Status: Fixed
Assigned to: -Deleted Account- <bjg>Open/Closed: Closed
Release: 1.11

Thu Nov 20 21:07:03 2008, comment #1:

fixed by 2b071dcaf42368cdb21691beb30cd761e7e38f6e

-Deleted Account- <bjg>In charge of this item.
Thu Oct 9 19:25:40 2008, original submission:

Reply-To: -unavailable-
From: "L. A. Pritchett-Sheats" <lpritch@lanl.gov>
To: -unavailable-
Subject: [Help-gsl] Negative chi squared value in MC Vegas
Date: Tue, 7 Oct 2008 09:55:06 -0600 (MDT)

[1 <text/plain; iso-8859-1 (8bit)>]
Thought I would post this on the help list before reporting this as a bug.

I'm writing an integration package which calculates N dimensional
integrals on infinite intervals using the GSL Monte Carlo functions. I'm
using tan(pi/2 x) to transform the integral to the (0,1) domain. For
different functions, I've seen negative values for the chi/dof values.
This is a reproducer integrating a gaussian on (0,+inf) that follows the
sample code found in the GSL manual where I've seen this problem on both a
Mac ( 10.4.11, Intel ) and a Linux machine (AMD Operton 86x_64). Although
the values differ on the two machines, at least 2-3 calls in the loop will
return a negative value for chi/dof.

I searched through the bug list archives and I didn't see this reported.
Is this a bug or am I doing something wrong here?

Compile: gcc -o vegas.x gaussian_vegas.c -lgsl -lgslcblas -lm

Output from the Mac

After warm up ====================
result = 5.000000214E-01
est error = 3.714575544E-08
answer = 5.000000000E-01
true error = 2.136549626E-08
sigma = 0.575
chisq/dof = 0.648
result = 4.999999999E-01 sigma = 3.757398332E-10 chisq/dof = 0.000
result = 4.999999995E-01 sigma = 3.830138812E-10 chisq/dof = -64.000
result = 5.000000006E-01 sigma = 3.842008411E-10 chisq/dof = -64.000
result = 5.000000003E-01 sigma = 3.900425646E-10 chisq/dof = 64.000
result = 5.000000000E-01 sigma = 3.869444558E-10 chisq/dof = 64.000
result = 4.999999998E-01 sigma = 3.927335539E-10 chisq/dof = -64.000
result = 4.999999994E-01 sigma = 3.912789134E-10 chisq/dof = 0.000
result = 5.000000002E-01 sigma = 3.898697784E-10 chisq/dof = 0.000
result = 5.000000000E-01 sigma = 3.983946547E-10 chisq/dof = -64.000
result = 5.000000001E-01 sigma = 3.881925195E-10 chisq/dof = -64.000
Final results ====================
result = 5.000000001E-01
est error = 3.881925195E-10
answer = 5.000000000E-01
true error = 1.362355784E-10
sigma = 0.351

Lori A. Pritchett-Sheats, PhD.

-Deleted Account- <bjg>In charge of this item.


Attached Files
file #16641:  gaussian_vegas.c added by bjg (4kB - text/x-csrc)


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Please enter the title of George Orwell's famous dystopian book (it's a date):



Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Thu Nov 20 21:07:03 2008bjgStatusConfirmed=>Fixed
  Assigned toNone=>bjg
Thu Oct 9 19:25:40 2008bjgAttached File-=>Added gaussian_vegas.c, #16641

Back to the top

Powered by Savane 3.1-cleanup