mailr27203 - /trunk/specific_analyses/relax_disp/optimisation.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on January 16, 2015 - 23:19:
Author: tlinnet
Date: Fri Jan 16 23:19:50 2015
New Revision: 27203

URL: http://svn.gna.org/viewcvs/relax?rev=27203&view=rev
Log:
Implemented storing of sum of squares and the standard deviation of these for 
relaxation dispersion, when doing a point calculation.

Task #7882 (https://gna.org/task/?7882): Implement Monte-Carlo simulation, 
where errors are generated with width of standard deviation or residuals.

Modified:
    trunk/specific_analyses/relax_disp/optimisation.py

Modified: trunk/specific_analyses/relax_disp/optimisation.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/optimisation.py?rev=27203&r1=27202&r2=27203&view=diff
==============================================================================
--- trunk/specific_analyses/relax_disp/optimisation.py  (original)
+++ trunk/specific_analyses/relax_disp/optimisation.py  Fri Jan 16 23:19:50 
2015
@@ -119,7 +119,7 @@
     @type spin_lock_nu1:        list of lists of numpy rank-1 float arrays
     @keyword relax_times_new:   The interpolated experiment specific fixed 
time period for relaxation (in seconds).  The dimensions are {Ei, Mi, Oi, Di, 
Ti}.
     @type relax_times_new:      rank-4 list of floats
-    @keyword store_chi2:        A flag which if True will cause the spin 
specific chi-squared value to be stored in the spin container.
+    @keyword store_chi2:        A flag which if True will cause the spin 
specific chi-squared value to be stored in the spin container together with 
the sum of squares of the residuals and the standard deviation of the sum of 
squares of the residuals.
     @type store_chi2:           bool
     @return:                    The back-calculated R2eff/R1rho value for 
the given spin.
     @rtype:                     numpy rank-1 float array
@@ -215,10 +215,15 @@
     # Make a single function call.  This will cause back calculation and the 
data will be stored in the class instance.
     chi2 = model.func(param_vector)
 
-    # Store the chi-squared value.
+    # Get the sum of squares 'sos' of the residuals between the fitted 
values and the measured values. Get the std deviation of these, std_sos.
+    sos, sos_std = model.get_sum_of_squares()
+
+    # Store the chi-squared value, sums of squares of residual and the 
standard deviation of sums of squares of residual.
     if store_chi2:
         for spin in spins:
             spin.chi2 = chi2
+            spin.sos = sos
+            spin.sos_std = sos_std
 
     # Return the structure.
     return model.get_back_calc()




Related Messages


Powered by MHonArc, Updated Fri Jan 16 23:20:02 2015