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

Home » Public Forums » archive » chisq value
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: chisq value [message #85907 is a reply to message #85872] Tue, 17 September 2013 09:31 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Monday, September 16, 2013 1:11:11 AM UTC-4, sid wrote:
> Hello everyone,
>
> I am trying to understand what is the chisq keyword means in the routine,
>
> poly_fit,
>
> svdfit
>
> linfit
>
>
>
> So I took a simple example, x=[1,2,3,4],y=[1,2,3,4]
>
> when I give
>
> p=poly_fit(x,y,1,chisq=c)
>
> c= 1.14631e-30
>
> p=svdfit(x,y,2,chisq=c)
>
> c= 2.86139e-13
>
> p=linfit(x,y,chisqr=c)
>
> c=0.00000
>
>
>
> for poly_fit and linfit the definition of chisq is the same
>
> "Set this keyword to a named variable that will contain the value of the unreduced chi-square goodness-of-fit statistic"
>
>
>
> But the chisq values are different in both these cases even though the inputvalues given are same.
>
>
>
> Could anyone please let me know what this chisq fit actually means.

I agree with what Mats said. This is numerical round-off error, which is computer-dependent.

An additional point is that these routines are using different levels of numerical precision. Round-off error for floating point (which is usually the default precision), is typically ~1e-7, and for double precision is ~1d-16. After you square the residuals, you get squared round-off errors of ~1e-14 and ~1d-32, which is close to some of the numbers you get.

If you force your X and Y arrays to be double precision, then the values of chi-square are much smaller.

Craig
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: RTV_DOIT to EVF
Next Topic: IDL X11 forwarding segmentation fault

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

Current Time: Wed Oct 08 17:33:09 PDT 2025

Total time taken to generate the page: 0.00452 seconds