mailr27210 - /trunk/pipe_control/error_analysis.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:20:
Author: tlinnet
Date: Fri Jan 16 23:20:06 2015
New Revision: 27210

URL: http://svn.gna.org/viewcvs/relax?rev=27210&view=rev
Log:
Extended backend in pipe_control.error_analysis.monte_carlo_create_data() to 
return errors as the standard deviation of the sum of squares of the residual.

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

Modified:
    trunk/pipe_control/error_analysis.py

Modified: trunk/pipe_control/error_analysis.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/error_analysis.py?rev=27210&r1=27209&r2=27210&view=diff
==============================================================================
--- trunk/pipe_control/error_analysis.py        (original)
+++ trunk/pipe_control/error_analysis.py        Fri Jan 16 23:20:06 2015
@@ -87,7 +87,7 @@
         raise RelaxError("Monte Carlo simulations have not been set up.")
 
     # Test the method argument.
-    valid_methods = ['back_calc', 'direct']
+    valid_methods = ['back_calc', 'direct', 'sum_squares']
     if method not in valid_methods:
         raise RelaxError("The simulation creation method " + repr(method) + 
" is not valid.")
 
@@ -97,7 +97,7 @@
     # Loop over the models.
     for data_index in api.base_data_loop():
         # Create the Monte Carlo data.
-        if method == 'back_calc':
+        if method == 'back_calc' or method == 'sum_squares':
             data = api.create_mc_data(data_index)
 
         # Get the original data.
@@ -109,7 +109,12 @@
             continue
 
         # Get the errors.
-        error = api.return_error(data_index)
+        # If the distribution to which to draw the errors from, should come 
from the standard deviation from the sum of squares of residuals from the 
minimisation.
+        if method == 'sum_squares':
+            error = api.return_error_sum_squares(data_index)
+
+        else:
+            error = api.return_error(data_index)
 
         # List type data.
         if isinstance(data, list) or isinstance(data, ndarray):




Related Messages


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