comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » doubt in chisq value
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
doubt in chisq value [message #73215] Sun, 31 October 2010 23:43 Go to next message
sid is currently offline  sid
Messages: 50
Registered: January 1995
Member
Hi,
I am fitting my data with svdfit (2 degree polynomial), now I need
to know how exactly the chisq value is calculated in this routine,
because I need to know the goodness of fit. For my data which I am
fitting I am getting chisq values which varies from 6.3534419e-07 to
8.0278877e-09 for different datasets. But please help how the routine
is performing the chisq calculation and how can I find the goodness of
fit from it.
thanking you
sid
Re: doubt in chisq value [message #73343 is a reply to message #73215] Tue, 02 November 2010 07:59 Go to previous message
David Gell is currently offline  David Gell
Messages: 29
Registered: January 2009
Junior Member
On Nov 2, 2:29 am, sid <gunvicsi...@gmail.com> wrote:
> On Nov 1, 7:48 pm, wlandsman <wlands...@gmail.com> wrote:
>
>
>
>> On Nov 1, 2:43 am, sid <gunvicsi...@gmail.com> wrote:
>
>>> Hi,
>>>     I am fitting my data with svdfit (2 degree polynomial), now I need
>>> to know how exactly the chisq value is calculated in this routine,
>>> because I need to know the goodness of fit. For my data which I am
>>> fitting I am getting chisq values which varies from 6.3534419e-07 to
>>> 8.0278877e-09 for different datasets. But please help how the routine
>>> is performing the chisq calculation and how can I find the goodness of
>>> fit from it.
>>> thanking you
>>> sid
>
>> You are almost certainly supplying unrealistic error bars (sigma
>> values).
>> Chisq can be calculated from the single line (e.g. see curvefit.pro)
>
>> chisq = total(Weights*(y-yfit)^2)/nfree
>
>> where weights = 1/sigma^2 , and nfree is the number of data points
>> minus the number of free parameters.
>
>> --Wayne
>
> Does the sigma value denote the error in each y value? If so can you
> suggest me how to find the error for each y value, mine is a spectral
> data. I am fitting a spectral line with 2 degree polynomial.
> thanking you
> sid
> sid

You seem to be asking some very basic questions about the propagation
of errors and data reduction. I would suggest you check out the
textbook "Data Reduction and Error Analysis for the Physical Sciences"
by Bevington and Robinson. Chapter 1, "Uncertainties in Measurements",
chapter 3 "Error Analysis" and chapter 11, "Testing the Fit" discuss
the questions you are asking.

As far as determining the error (precision is a better term) in each y
value, that depends to a certain extent on how the data is collected.
If you don't know how the data is collected, use the same value of
sigma for each measurement, which is equivalent of stating that all of
the measurements are equally good. If the spectra is obtained using a
counting detector, you might use sqrt(Yn) for sigma(Yn), Poisson
statistics. If your spectra is obtained by an analog device, measuring
say current, you might use a fraction of the signal as the measurement
error.

If you are trying to fit a function to a spectral line, a polynomial
may not be a good choice, unless you limit the data to a few points
around the peak. Better choices might be a Gaussian or Lorentzian. The
Lorentzian will model a spectra line with wings. Both line shapes have
3 parameters, a center, width and amplitude. If you are modeling a
composite spectra, you can use a sum of Gaussians, each with different
parameters.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: read FITS header keyword using IDL Astronomy users's library
Next Topic: !P.Multi Broken in IDL 8.0.1

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 09:17:38 PDT 2025

Total time taken to generate the page: 0.24013 seconds