Hi Barbara,Looking at this data I don't think Larch found a fit... Try overlaying a plot of your fit with your data and see if the fit was any good.I'd check the assumptions again and change the initial guesses around. Since this is a multi-dimensional fit, the initial guesses could change the results quite a bit. A small chi_sq in physics typically means that the errorbars on the data is too big, though I don't know how that would factor into XAFS... Where's your cutoff for the R-value when you're fitting? If it's at a R where you are still expecting data, that might be the issue (?)----------Hanyu (Alice) ZhangMaster's in Materials science | 2019Research in utilizing XAFS to match current theory of metallic glasses to experimental dataAcademic achievements:Honors societies: National Society of Collegiate Scholars | Tau Beta Pi | Pi Mu EpsilonOther interests:Clubs: Case Origami Circle | Case Rocket Team | CWRUbotix | Case Physics and Astronomy club | Math club_______________________________________________On Sun, Oct 7, 2018 at 5:56 PM Barbara Etschmann <barbara.etschmann@monash.edu> wrote:Hi Matt and HanyuThanks - the latest version of larch runs wrtntot1 = param(expr='nO1+nO2', min=5.0, max=8.5, vary=True)However, still getting odd gofs/errors:[[Statistics]]nvarys, npts = 6, 390n_independent = 11.186chi_square = 0.00080359reduced chi_square = 0.000154956r-factor = 0.01850Akaike info crit = -94.7257Bayesian info crit = -92.2378....delrO1 = 0.132140 +/- unknown (init= 0.150000)delrO2 = -0.446980 +/- unknown (init= -0.500000)enot = -4.125159 +/- unknown (init= 0.000000)nO1 = 7.000000 +/- unknown (init= 7.000000)nO2 = 0.929177 +/- unknown (init= 1.000000)ntot1 = 7.929177 +/- unknown = 'nO1+nO2'ssO1 = 0.006499 +/- unknown (init= 0.003000).....(Please ignore the large init value.)Running on a Mac 10.13.3.Happy to send the script & output.ThanksBarb._______________________________________________On Fri, 5 Oct 2018 at 23:02, Matt Newville <newville@cars.uchicago.edu> wrote:_______________________________________________Hi Hanyu, Barbara,On Fri, Oct 5, 2018 at 12:55 AM Hanyu Zhang <hxz269@case.edu> wrote:Hi,Thought I'd give my two cents before the experts chime in... I'm only a grad student right now though so make what you want out of it. I also haven't touched Larch for a while now since I got my xafs (Larch) functions working in python several months ago.First off though, ntot1 = param(expr='nO1+nO2', min=5.0, max=8.5) ran without throwing an error in Larch for me... (See screenshot near the middle of this email) So I don't think anyone can really help without more details, but I want to comment on some things:
- The first thing is that you're missing a vary = True in the statement for ntot1. Since the default value for vary is False according to the website, I would add that in if you actually wanted it to be fitted for during the fitting process (https://xraypy.github.io/xraylarch/fitting/parameters.html).
- In addition, when you run ntot1 = param(expr='nO1+nO2', min=5.0, max=8.5), are nO1 and nO2 pre-defined? If not the computer's not going to know what to make of those variables.
- I'd recommend something along the lines of:
nO1 = param(7.0, min=5, max=7, vary=True)nO2 = param(1, vary=True),ntot1 = param(expr='nO1+nO2', min=5.0, max=8.5, vary=True)I just tested this on my machine and it didn't throw any errors. (Though it also didn't throw any errors without the 2 fixes I recommended...):I didn't think to check when I took that screenshot but with that line, the vary is in fact set to false:larch> ntot1.vary
False
In terms of the errors on error calculation --
- What's the reduced chi-sq? What do you mean by very small? In physics you want that to be as close to one as possible. Though in xafs the reduced chi-sq apparently is typically around 100-1000 so I'm confused as to what you mean by "small". Also, if you're having issues with errorbars to begin with, I wouldn't trust the chi-sq since that calculation relies on how big the errorbars are. If the errors are NAN, who knows what the computer would do to divide those numbers...
- What do you mean by "errors are not reported"? After the fit, it's returned in feffit.residual, or something along those lines (http://cars9.uchicago.edu/xraylarch/fitting/results.html#fitting-results-sec)... I haven't actually used this myself, so I can't say more.
- (Just a comment...) I don't know if this would help but my physics professor didn't let me trust the reduced chi-sq and gof values I was getting until I found out how the errors were calculated. By default, the errors are calculated by assuming that the noise is white in R-space and that there's no signal at high-R, so the "signal" near your rmax is the noise. (http://cars9.uchicago.edu/xraylarch/xafs/utilities.html#_xafs.estimate_noise, second to last paragraph)
Hope this was at least somewhat helpful,
----------Hanyu (Alice) ZhangMaster's in Materials science | 2019Research in utilizing XAFS to match current theory of metallic glasses to experimental dataAcademic achievements:Honors societies: National Society of Collegiate Scholars | Tau Beta Pi | Pi Mu EpsilonOther interests:Clubs: Case Origami Circle | Case Rocket Team | CWRUbotix | Case Physics and Astronomy club | Math clubOn Thu, Oct 4, 2018 at 8:04 PM Barbara Etschmann <barbara.etschmann@monash.edu> wrote:HelloI'm trying to use larch to refine the coordination of Y in solution. I need to use 2xO paths to fit the first shell and would like to restrain the total coordination to be between 5.5 and 8.I can apply the constraint to each nO, but not the total, i.e.nO1 = param(7.0, min=5, max=7, vary=True),nO2 = param(1, vary=True),butntot1 = param(expr='nO1+nO2', min=5.0, max=8.5)does not work.How can I restrain the total coordination?I think that should work. But I can also believe it doesn't ;). It may require a recent version of Larch (0.39 or 0.40 and really lmfit). I'll try to verify that over the next couple of days.Also, having some problems with the gofs and errors - the chi square is rather small and often the errors are not reported and it is not clear why.Hm, not sure. Can you post an example?Cheers,--Matt
Ifeffit mailing list
Ifeffit@millenia.cars.aps.anl.gov
http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
Ifeffit mailing list
Ifeffit@millenia.cars.aps.anl.gov
http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
Ifeffit mailing list
Ifeffit@millenia.cars.aps.anl.gov
http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit