Re: I should be able to find this somewhere...
On Friday 13 January 2006 20:25, you wrote:
By what factor is the residual multiplied when plotted in Artemis? I can't find that figure quoted. mam
The residual is saved in k-space and Fourier transformed. B -- Bruce Ravel ---------------------------------------------- bravel@anl.gov Molecular Environmental Science Group, Building 203, Room E-165 MRCAT, Sector 10, Advanced Photon Source, Building 433, Room B007 Argonne National Laboratory phone and voice mail: (1) 630 252 5033 Argonne IL 60439, USA fax: (1) 630 252 9793 My homepage: http://cars9.uchicago.edu/~ravel EXAFS software: http://cars9.uchicago.edu/~ravel/software/
Hi, Maybe I missed an important part of the discussion, but that won't stop me from sticking my nose in...
By what factor is the residual multiplied when plotted in Artemis? I can't find that figure quoted. mam
The residual is saved in k-space and Fourier transformed.
... which ought to be the same as taking the residual of chi(R). What's typically plotted (with Artemis and everywhere else) is |chi(R)|. When plotting the magnitude like this and selecting "show residual", the magnitude of the residual is shown: |chi_data(R)-chi_fit(R)|, not the invidiual differences of real and imaginary components. --Matt
The background of this is that I'm running Artemis on Windows, and I get some odd things happening when I select Display Residuals. The residual often shows as bigger than what's being fit. At first, I thought that maybe it was being amplified by some factor in order to display better, but then I realized that the behavior I'm seeing is inconsistent with that. For instance, the residual coincides with the data at R greater than where the last fit path peters out. It's almost as if I'm seeing |fit+data| and not |fit-data|. mam Matt Newville wrote:
Hi,
Maybe I missed an important part of the discussion, but that won't stop me from sticking my nose in...
By what factor is the residual multiplied when plotted in Artemis? I can't find that figure quoted. mam
The residual is saved in k-space and Fourier transformed.
... which ought to be the same as taking the residual of chi(R). What's typically plotted (with Artemis and everywhere else) is |chi(R)|. When plotting the magnitude like this and selecting "show residual", the magnitude of the residual is shown: |chi_data(R)-chi_fit(R)|, not the invidiual differences of real and imaginary components.
--Matt
_______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
HI Matthew, It may help to diagnose the possible problem (either with Artemis or perhaps with the fit?) if you plot the residuals while plotting the Real or Imaginary part of chi(R) instead of the Magnitude of chi(R). That is, with the Real or Imaginary parts, the residual should be more easily interpretable, as it really will be Data-Fit. FWIW, in principle the magnitude of the residual could be larger than the data if the best fit is very far out of phase with the data. That would give a terrible fit, of course. --Matt
I tried that. The fit I'm thinking of is pretty good. Subtraction by eye
disagrees grossly
with what I see. I suspect it's another one of those Windows-and-Linux
things.
mam
----- Original Message -----
From: "Matt Newville"
HI Matthew,
It may help to diagnose the possible problem (either with Artemis or perhaps with the fit?) if you plot the residuals while plotting the Real or Imaginary part of chi(R) instead of the Magnitude of chi(R). That is, with the Real or Imaginary parts, the residual should be more easily interpretable, as it really will be Data-Fit. FWIW, in principle the magnitude of the residual could be larger than the data if the best fit is very far out of phase with the data. That would give a terrible fit, of course.
--Matt
_______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
Hi Matthew,
I tried that. The fit I'm thinking of is pretty good. Subtraction by eye disagrees grossly with what I see. I suspect it's another one of those Windows-and-Linux things.
Hmm, not sure. A simple fit I've been working on in Windows and Mac OS does look like it's showing the residual correctly (and consistently on both systems). Can you send an example project? Thanks, --Matt
Here's the one I sent to Bruce. It's a fit of hematite. Look at fit11, which is the best of the bunch. The later fits represent lots of screwing around I did. It seems that some projects show this problem and others don't. I wonder if it may be because the data didn't come from Athena, but was interpolated from my programs. mam Matt Newville wrote:
Hi Matthew,
I tried that. The fit I'm thinking of is pretty good. Subtraction by eye disagrees grossly with what I see. I suspect it's another one of those Windows-and-Linux things.
Hmm, not sure. A simple fit I've been working on in Windows and Mac OS does look like it's showing the residual correctly (and consistently on both systems).
Can you send an example project? Thanks,
--Matt
_______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
Sorry about that! I meant to send this to Matt alone and didn't see the
Reply-To.
mam
----- Original Message -----
From: "matthew marcus"
Here's the one I sent to Bruce. It's a fit of hematite. Look at fit11, which is the best of the bunch. The later fits represent lots of screwing around I did. It seems that some projects show this problem and others don't. I wonder if it may be because the data didn't come from Athena, but was interpolated from my programs. mam
Matt Newville wrote:
Hi Matthew,
I tried that. The fit I'm thinking of is pretty good. Subtraction by
eye disagrees
grossly with what I see. I suspect it's another one of those Windows-and-Linux things.
Hmm, not sure. A simple fit I've been working on in Windows and Mac OS does look like it's showing the residual correctly (and consistently on both systems).
Can you send an example project? Thanks,
--Matt
_______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
---------------------------------------------------------------------------- ----
_______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
Hi Matthew, Bruce, OK, I think it's a bug. Well, maybe it's just a consequence of a "known but not well advertised" problem. The chi(k) data you have doesn't start at k=0. By itself, this should be OK, and the fit seems to be mostly fine. There seems to be a bug in Ifeffit that the output fit chi(k) has the same number of data points as the input chi(k) data. In this case is incorrect -- it should go to the last data point in k. From looking at the code, I'm pretty sure this has no effect on the fit and is only an error in the output array. But the shortened chi_fit(k) will have an impact on the way Bruce is calculating the residual. Even if that were fixed, the residual would still be wrong, as the residual in Artemis is calculated as set(data0_res.k = data0.k) set(data0_res.chi = data0.chi - data0_fit.chi) and then Fourier transforming to R-space. Since the data and fit aren't aligned in k-space, the residual is incorrect. It should be set(data0_res.chi = data0.chi - interp(data0_fit.k, data0_fit.chi, data0.k)) or some variation on that. Sorry for the trouble. It's definitely a result of narrow-mindedly expecting that all chi(k) data comes from Ifeffit/Athena and will always start at k=0. We should get this fixed (it's mostly there!) so that data from other sources can be used. Right now, the easiest work-around is to pre-pack the chi(k) data with zeros (starting from k=0.00) --Matt
Hi, In fact, Artemis and Athena both attempt to deal correctly with input chi(k) data that is not on the expected grid. Both codes perform a test to see if the data is on the standard grid and, if not, front-loads the data with zeros and uses Ifeffit's boxcar rebinning function to put the data on the expected grid. Alas, there was a bug in the rebinning macro used by A&A which caused it to fail in a particular situation met by the data in Matthew's example. This bug will be fixed in the next release. If you import mu(E) data into Athena and then import data from the Athena project file into Artemis, you will never see the problem that Matthew reported. B On Tuesday 17 January 2006 16:09, Matt Newville wrote:
Hi Matthew, Bruce,
OK, I think it's a bug. Well, maybe it's just a consequence of a "known but not well advertised" problem.
The chi(k) data you have doesn't start at k=0. By itself, this should be OK, and the fit seems to be mostly fine. There seems to be a bug in Ifeffit that the output fit chi(k) has the same number of data points as the input chi(k) data. In this case is incorrect -- it should go to the last data point in k. From looking at the code, I'm pretty sure this has no effect on the fit and is only an error in the output array. But the shortened chi_fit(k) will have an impact on the way Bruce is calculating the residual. Even if that were fixed, the residual would still be wrong, as the residual in Artemis is calculated as set(data0_res.k = data0.k) set(data0_res.chi = data0.chi - data0_fit.chi)
and then Fourier transforming to R-space. Since the data and fit aren't aligned in k-space, the residual is incorrect. It should be
set(data0_res.chi = data0.chi - interp(data0_fit.k, data0_fit.chi, data0.k))
or some variation on that.
Sorry for the trouble. It's definitely a result of narrow-mindedly expecting that all chi(k) data comes from Ifeffit/Athena and will always start at k=0. We should get this fixed (it's mostly there!) so that data from other sources can be used. Right now, the easiest work-around is to pre-pack the chi(k) data with zeros (starting from k=0.00)
--Matt
_______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
-- Bruce Ravel ---------------------------------------------- bravel@anl.gov Molecular Environmental Science Group, Building 203, Room E-165 MRCAT, Sector 10, Advance Photon Source, Building 433, Room B007 Argonne National Laboratory phone and voice mail: (1) 630 252 5033 Argonne IL 60439, USA fax: (1) 630 252 9793 My homepage: http://cars9.uchicago.edu/~ravel EXAFS software: http://cars9.uchicago.edu/~ravel/software/
participants (4)
-
Bruce Ravel
-
Matt Newville
-
Matthew
-
matthew marcus