Closed yugangzhang closed 8 years ago
@afluerasu Reply
result = fit_saxs_g2( g2, res_pargs, function = 'stretched', vlim=[0.95, 1.05], fit_variables={'baseline':True, 'beta':True, 'alpha':False,'relaxation_rate':True},guess_values={'baseline':1.0,'beta':0.1,'alpha':1.0,'relaxation_rate':0.01})
alpha is, as you may guess the stretch exponent setting a value of 'False' in the fit_variables dictionary results in that particular parameter not being fitted. It's be value will be fixed to whatever is specified in guess_values
Reply from Christa Wagenbach [hoskin.christa@gmail.com]
I tried adding this to my code:
result = fit_gisaxs_g2( g2, res_pargs, function = 'stretched', vlim=[0.95, 1.05], fit_variables={'baseline':False, 'beta':True, 'alpha':True,}, guess_values={'baseline':1.0,'beta':0.009,'alpha':0.5,})
and even though the baseline is set to False it doesn't seem to fix the baseline at 1, as specified. Is there something that I am misunderstanding or is it possible the code has a bug?
I have attached a few pictures to demonstrate....
Please restart your Jupyter Kernel by click "Restart and clear up" in "Kernel" Tab. You might have to do several times (might due to Jupyte itself bug) to make sure the kernel actually restart.
The stretched exponential fitting routine for the g2 functions does not seem to work very well. I think it would be better if we could have some control over the limitations of the fitting parameters. For example, we often restrict the baseline to be one or close to one and that typically improves the fits. Is this something you can implement for us? Being able to restrict the tau values would also be useful. I have included an image demonstrating the typical stretched exponential fits and you will be able to see that they are quite bad...
This bug is created by Yugang for Christa Wagenbach [hoskin.christa@gmail.com]