Menu

SVN archive Commit Log


Commit Date  
[r25286] by tlinnet

Got the Quasi-Newton BFGS to work.

This uses only the gradient, this gets the same results as 2000 Monte-Carlo with simplex and scipy.optimize.leastsq.

Error estimation still not provided.

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

2014-08-26 11:23:44 Tree
[r25285] by tlinnet

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.

2014-08-26 11:12:14 Tree
[r25284] by bugman

Switched the optimisation algorithm in test_suite/system_tests/scripts/relax_fit.py.

This script, used by the Relax_fit.test_curve_fitting_height and Relax_fit.test_curve_fitting_volume
system tests, now uses the BFGS optimisation. This is to demonstrate that the exponential curve
gradient function dfunc() is implemented correctly and that more advanced optimisation algorithms
can be used (excluding those that require the full Hessian d2func() function).

2014-08-26 10:51:21 Tree
[r25283] by bugman

Fix for the test_dfunc_off_minimum() unit test.

This is the test class test_suite.unit_tests._target_functions.test_relax_fit.Test_relax_fit. The
wrong gradient was being scaled.

2014-08-26 10:47:28 Tree
[r25282] by bugman

Bug fix for the chi-squared gradient calculation in the C module.

The definition of the square() function needed extra brackets so that the 1/error**2 calculation
would be 1/(error*error) rather than the incorrect 1/error*error form.

2014-08-26 10:44:12 Tree
[r25281] by bugman

Increased the printouts for the script for calculating the numerical gradient for an exponential curve.

2014-08-26 10:29:49 Tree
[r25280] by bugman

Fix for the script for calculating the numerical gradient for an exponential curve.

The off-minimum derivative was not correctly calculated.

2014-08-26 10:24:57 Tree
[r25279] by bugman

The exponential curve numeric gradient script now uses only floating point numbers.

This is to avoid integer truncation problems.

2014-08-26 10:20:49 Tree
[r25278] by bugman

Activated parameter scaling of the gradient in the test_dfunc_off_minimum() unit test.

This is the test class test_suite.unit_tests._target_functions.test_relax_fit.Test_relax_fit.

2014-08-26 10:17:23 Tree
[r25277] by bugman

Fixes for the target_functions.relax_fit C module unit tests.

All values are now set to floats to avoid integer division issues.

2014-08-26 10:14:28 Tree
Older >
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.