Menu

Commit [r25285]  Maximize  Restore  History

Got the method of 'Steepest descent' to work properly, by specifying the Jacobian correctly.

The Jacobian was derived according to the chi2 function.

The key point was to evaluate the two derivative arrays for all times points, and
and then sum each of the two arrays together, before constructing the Jacobian.

This clearly shows the difference between minfx and scipy.optimize.leastsq.

scipy.optimize.leastsq takes as input a function F(x0), which should return the array
of weighted differences between function value and measured values:
" 1. / self.errors * (self.calc_exp(self.times, *params) - self.values) "

This will be an array with number of elements 'i' corresponding to number of elements.
scipy.optimize.leastsq then internally evaluates the sum of squares -> sum[ (O - E)**2 ],
and minimises this. This is the chi2.

Minfx requires the function to minimise before hand.
So, the "func" should be chi2.

Then the dfunc, and d2func, should be derivative of chi2, bum all elements in the array should
still be summed together.

task #7822(https://gna.org/task/index.php?7822): Implement user function to estimate R2eff and associated errors for exponential curve fitting.

tlinnet 2014-08-26

changed /trunk/specific_analyses/relax_disp/estimate_r2eff.py
/trunk/specific_analyses/relax_disp/estimate_r2eff.py Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.