bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] Bug(?) in reproducing gsl_multilinear_wfit test case


From: Jim Heasley
Subject: [Bug-gsl] Bug(?) in reproducing gsl_multilinear_wfit test case
Date: Wed, 25 Apr 2012 07:33:56 -1000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20

I'm sorry to bother you folks with what should be simple, but
I have been unable to get the sample code that executes the
routine gsl_multilinear_wfit.c (which I literally cut and
pasted from the on-line HTML documentation) to give an answer
that is the same or even close to what is given in the
documentation. Best as I can see this is not reported in the BUGS
list or in the on-line bug reports, but I must admit to some difficulty
navigating them.

The input data for the test is created using the program generate.c which
computes

            y = exp(x) + noise

where 0.1 <= x <= 2.0. As the noise -> 0 one should recover the
Taylor expansion of exp(x), namely

        exp(x) = 1.0 + x/1! + x^2/2! + ...

which is in fact what is shown in the documentation for this case
(allowing for the fact some considerable amount of noise has been
added).

My compiled  code gives the result

        # best fit: Y = 1.18246 + 0.184573 X + 1.3031 X^2

If I cut the noise size down in generate by setting
double sigma = 0.00001*y0 then I should get close to the analytic
values, but instead get

       # best fit: Y = 1.08437 + 0.435157 X + 1.24313 X^2

I am running the code on a Ubuntu 10.03 LTS platform with an
AMD Phenom processor with GSL version 1.15. The same behavior (and
exactly the same answers are found on a 32 bit AMD XP2400  processor
with GSL 1.9 or GSL 1.15)

I have recompiled the library turning off all optimization in all
modules to no avail, same results.

So, having run out of ideas and having tested all the "standard"
kind of stuff I'm submitting this report. (BTW, I tried the test
example immediately preceding this one in the documentation and
it reproduces the result in the manual perfectly.) I'm attaching to
this report the following files:

    1) generate.c       - data generate (cut/pasted from the web)
    2) exp.dat          - output from above, input to fit
    3) fit.c            - data fitter (cut/pasted from the web)
    4) fit.output       - output from fit.c and exp.dat

Please let me know if there is any other information I can provide to
help explain this rather strange result.

--
Jim Heasley

Institute for Astronomy                 address@hidden
University of Hawaii                    phone: 808-956-6826
2680 Woodlawn Drive                     fax:   808-956-4532
Honolulu, HI 96822

Attachment: generate.c
Description: Text Data

Attachment: exp.dat
Description: Netscape Proxy Auto Config

Attachment: fit.c
Description: Text Data

Attachment: fit.output
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]