Menu

SVN archive Commit Log


Commit Date  
[r25229] by tlinnet

Added verification script, that shows that using scipy.optimize.leastsq reaches the exact same parameters as minfx for exponential curve fitting.

The profiling shows that scipy.optimize.leastsq is 10X as fast as using minfx (with no linear constraints.)
scipy.optimize.leastsq is a wrapper around wrapper around MINPACK's lmdif and lmder algorithms.

MINPACK is a FORTRAN90 library which solves systems of nonlinear equations, or carries out the least squares minimization of the residual of a set of linear or nonlinear equations.

The verification script also shows, that a very heavy and time consuming monte carlo simulation of 2000 steps, reaches the same
errors as the errors reported by scipy.optimize.leastsq.

The return from scipy.optimize.leastsq, gives the estimated co-variance.
Taking the square root of the co-variance corresponds with 2X error reported by minfx.

This could be an extremely time saving step, when performing model fitting in R1rho, where
the errors of the R2eff values, are estimited by Monte-Carlo simulations.

The following setup illustrates the problem.
This was analysed on a: MacBook Pro, 13-inch, Late 2011.
Witn no multi-core setup.

Script running is:
test_suite/shared_data/dispersion/Kjaergaard_et_al_2013/2_pre_run_r2eff.py

This script analyses just the R2eff values for 15 residues.
It estimates the errors of R2eff based on 2000 Monte Carlo simulations.
For each residues, there is 14 exponential graphs.

The script was broken after 35 simulations.
This was measured to 20 minutes.
So 500 simulations would take about 4.8 Hours.
The R2eff values and errors can by scipy.optimize.leastsq can instead be calculated in: 15 residues * 0.02 seconds = 0.3 seconds.

2014-08-24 23:08:46 Tree
[r25228] by tlinnet

Further improved the profiling of relax curve fit.

This profiling shows, that Python code is about twice as slow as the C code implemented.

But it also shows that optimising with scipy.optimize.leastsq is 20 X faster.
It also gives reasonable error values.

Combining a function for a linear fit to guess the initial values, together
with scipy optimise, will be an extreme time win for estimating R2eff values fast.

A further test would be to use relax Monte-Carlo simulations for say 1000-2000 iterations,
and compare to the errors extracted from estimated covariance.

2014-08-24 23:08:44 Tree
[r25227] by tlinnet

Further extended the profiling script for curve fitting.

Now profiling is in place for the implemented C code method in relax.

A similar code should now be devised for numpy array for comparing.

But this profiling shows that when contraints=True, is slowing down this procedure by a factor 10 X !

2014-08-22 17:17:19 Tree
[r25226] by bugman

Added Nikolai's original Matlab code to the lib.dispersion.ns_r1rho_2site module docstring.

This is the code taken directly form the original funNumrho.m file, which was the origin of the code
in this module.

2014-08-22 17:00:56 Tree
[r25225] by tlinnet

Fix for looping over data indices, where tilt_angles has the si index.

bug #22461(https://gna.org/bugs/?22461): NS R1rho 2-site_fit_r1 has extremely high chi2 value in systemtest Relax_disp.test_r1rho_kjaergaard_missing_r1.

2014-08-22 14:27:25 Tree
[r25224] by tlinnet

Fix for systemtest not adding spin.isotope to setup information.

bug #22461(https://gna.org/bugs/?22461): NS R1rho 2-site_fit_r1 has extremely high chi2 value in systemtest Relax_disp.test_r1rho_kjaergaard_missing_r1.

2014-08-22 14:27:23 Tree
[r25223] by tlinnet

Moved the storing of relax time up before check of missing data in return_r2eff_arrays().

bug #22461(https://gna.org/bugs/?22461): NS R1rho 2-site_fit_r1 has extremely high chi2 value in systemtest Relax_disp.test_r1rho_kjaergaard_missing_r1.

2014-08-22 14:27:19 Tree
[r25222] by bugman

Merged revisions 25213 via svnmerge from
svn+ssh://bugman@.../svn/relax/trunk

........
r25213 | bugman | 2014-08-22 14:09:14 +0200 (Fri, 22 Aug 2014) | 7 lines

Improved data checking for all of the Structure system tests.

Before looping over the structural data, the number of lines in the real file and the newly
generated file are compared. This avoids the situation whereby an empty file is produced,
accidentally allowing the test to pass.
........

2014-08-22 14:02:50 Tree
[r25221] by bugman

Modified the Relax_disp.test_r1rho_kjaergaard_missing_r1 system test to pass on 64-bit Linux systems.

The accuracy of the checks of the optimised values have been decreased.

2014-08-22 13:50:08 Tree
[r25220] by tlinnet

Fix for systemtest Relax_disp.test_exp_fit(), where the spin.isotope was not set.

The new call to return_r2eff_arrays(), when producing graphs, raise RelaxSpinTypeError() if no isotope is set.

bug #22461(https://gna.org/bugs/?22461): NS R1rho 2-site_fit_r1 has extremely high chi2 value in systemtest Relax_disp.test_r1rho_kjaergaard_missing_r1.

2014-08-22 13:22:38 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.