Hi Walter, My concept of a histogram based fit works like this. 1. Compute the contribution from a scatterer at each bin of the histogram. 2. Multiply each such contribution by the population of that bin 3. Add up these weighted chi(k) functions 4. Normalize the sum of the chi(k) by the sum of the bin populations This results in an approximation of the contribution of a single atom distributed over the distribution given by the histogram. In Artemis, this is treated exactly like a normal path. One might say that a normal path is exactly like a histogram path except that its histogram is trivial -- one bin at one distance. The histogram path, like its normal path counterpart, must have the EXAFS equation evaluated. Thus the histogram path has an amplitude, an E0 shift, a delta R, and a sigma^2 that must, somehow, be evaluated. The amplitude is pretty easy to understand -- it represents coordination number and S02. That is, it tells you how many atoms are distributed over that distribution, given some value of S02. The E0 shift is similarly easy to understand. Like a normal path's E0 shift, it aligns the k-grid of the theory with the k-grid of the data. Delta R is bit more subtle. The way it is formulated in Demeter, Delta R is an over-all parameter for the distribution. That is, it moves the distribution up or down as a unit, without changing the positions of the bins within the distribution. sigma^2 is, perhaps, the hardest one to grok. Let's suppose that you do some kind of temperature dependent molecular dynamics calculation and come up with a distribution that correctly models both static and thermal disorder. In that wonderful case, sigma^2 should evaluate to 0. If you float that sigma^2 in a fit, it would be consistent with 0 within its error bar. If the floated sigma^2 is positive, that tells you that the distribution did not have enough disorder compared to the data. If that floated sigma^2 comes out negative, that tells you that the distribution had too much disorder. I should say that the example that you cited, the one in the draft of the Demeter Programming Guide, is an example from rather early on in my time developing this concept in Demeter. These days, I prefer to do all of the steps enumerated above completely behind the scenes and to rpesent a single path-like object to the user for use in the fit. If you examine the examples here: https://github.com/bruceravel/demeter/tree/master/examples/recipes/Histogram you will see that. You cannot, alas, run those example because it does not include the ENORMOUS output files from the MD simulations in my git repository. This is certainly among the many sketchily documented corners of Demeter. Hopefully what I wrote above helps clarify things. I will be talking about this in my talk at the XAFS15 conference, for those who will be there. Also, this reference is helpful: http://dx.doi.org/10.1103/PhysRevB.85.075439 B On Monday, June 25, 2012 03:21:06 AM Walter Fu wrote:
Hi all,
I'm trying to do a preliminary fit to the first shell of an amorphous material, using a histogram generated from diffraction data. I've been using a script similar to the one given here:
http://bruceravel.github.com/demeter/dpg/examples/histo.html
When I run my script, it creates an SS path for each histogram bin and then performs the fit, as expected. However, if I then query the fit object for a summary, I get a list of fitted values back. My question is, what is the meaning of these values? Do they refer to the fit as a whole, or individual paths within the fit? For instance, is the "delR" value the one which, when applied uniformly to all of the paths generated, produces the best fit? Or is it merely the value calculated for the last-used path (presumably the one corresponding to last bin in the histogram), which may be different for the second-to-last path or for the first path? I'm also a bit confused as to how the "amp" variable (line 30 in the script from the link given above) comes into play. Is the reported value a single multiplicative factor which is applied to the histogram-generated amplitudes of all the paths, or is there a separate "amp" for each path, with only the one corresponding to the last-accessed path being reported?
I've tried looking through the Demeter source to get the answers, but given my limited knowledge of Perl, my search is proving less than conclusive. Any explanations you could give would be greatly appreciated.
-Walter
-- Bruce Ravel ------------------------------------ bravel@bnl.gov National Institute of Standards and Technology Synchrotron Methods Group at NSLS --- Beamlines U7A, X24A, X23A2 Building 535A Upton NY, 11973 Homepage: http://xafs.org/BruceRavel Software: https://github.com/bruceravel