Re: doubt in chisq value [message #73213] |
Mon, 01 November 2010 07:48  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
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
|
|
|
Re: doubt in chisq value [message #73349 is a reply to message #73213] |
Tue, 02 November 2010 00:29  |
sid
Messages: 50 Registered: January 1995
|
Member |
|
|
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
|
|
|