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 authentication level.

bug #24510: Negative chi squared value in vegas

Submitter:  -Deleted Account- <bjg>
Submitted:  Thu 09 Oct 2008 07:25:40 PM UTC
Category:  Runtime error Severity:  3 - Normal
Operating System:  Status:  Fixed
Assigned to:  bjg Open/Closed:  Closed
Release:  1.11

Thu 20 Nov 2008 09:07:03 PM UTC, comment #1: 

fixed by 2b071dcaf42368cdb21691beb30cd761e7e38f6e

-Deleted Account- <bjg>
Thu 09 Oct 2008 07:25:40 PM UTC, original submission:  

Reply-To: -email is unavailable-
From: "L. A. Pritchett-Sheats" <lpritch@lanl.gov>
To: -email is 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>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2008-11-20 bjg StatusConfirmed Fixed
    Assigned toNone bjg
    Open/ClosedOpen Closed
2008-10-09 bjg Attached File- Added gaussian_vegas.c, #16641

Back to the top

Powered by Savane 3.12.
Corresponding source code