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

Home » Public Forums » archive » Re: mpfit2dpeak and chi-square
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: mpfit2dpeak and chi-square [message #46027] Tue, 25 October 2005 08:33
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
JJMeyers2@gmail.com writes:

> Hello,
>
> I am trying to use mpfit2dpeak and I am trying to understand the result
> that comes out of chi-square, so I was wondering if someone can help me
> out. I am describing the problem.
> I have an image with random star positions x,y (the image has 2048x2048
> pixels). I am trying to fit the positions to a 2-d gaussian. I have a
> vague idea where the central density of the stars should be and I
> create a square of 400x400pixels around it and I calculate the density
> of different circles in this square in order to fit it to a gaussian.
> After running mpfit2dpeak the results I get for the gaussian parameters
> and the errors are reasonable. When I use the keyword CHISQ though I
> get a very big number (245781 which divided by 160000 is 1.5) which is
> very big and is not reasonable since the errors are very small and the
> fit looks very good. I was wondering if I am using the chisq in a wrong
> way and the result that I get is not what I think it is.
> Any suggestions?

Greetings,

The key to getting a good chi-square value is (a) using the right
model function, and (b) having an appropriate estimate of the
measurement uncertainties.

A 2D gaussian function may or may not be appropriate for your stellar
profiles, only you can decide that. You can plot the residuals as a
function of position and see whether there are any systematic trends.
If there are, then it is likely that the 2D gaussian should be changed
to something else. (Many times stellar profiles are fit with an
empirical PSF).

The measurement uncertainties also need to be correct. The fact that
you say the "errors are very small" suggests that your measurement
uncertainties are too small, for one is a symptom of the other. Do
you have Poisson errors? Gaussian errors? Etc. A simple test you can
do is to fit a flat part with no stars to a constant function. Do you
get a reduced chi-square close to 1? If not, then you probably have
problems with your measurement uncertainties.

There are other systematic effects, for example if you have
flat-fielding errors or gradients, or if there are cosmic ray hits.
You'll have to check for those too.

Good luck,
Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Previous Topic: mpfit2dpeak and chi-square
Next Topic: orthogonal distance regression

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

Current Time: Wed Oct 08 17:56:22 PDT 2025

Total time taken to generate the page: 0.00524 seconds