Author: tlinnet
Date: Fri Jan 16 23:19:44 2015
New Revision: 27201

URL: http://svn.gna.org/viewcvs/relax?rev=27201&view=rev
Log:
Start of implementation of systemtest 
Relax_disp.test_task_7882_monte_carlo_std_residual, to test doing Monte-Carlo 
simulations with errors drawn from a
Gauss distribution with a width corresponding to the standard devition of the 
sum of squares of residuals.

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

Modified:
    trunk/test_suite/system_tests/relax_disp.py

Modified: trunk/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/relax_disp.py?rev=27201&r1=27200&r2=27201&view=diff
==============================================================================
--- trunk/test_suite/system_tests/relax_disp.py (original)
+++ trunk/test_suite/system_tests/relax_disp.py Fri Jan 16 23:19:44 2015
@@ -8525,6 +8525,47 @@
             spin_index += 1
 
 
+    def test_task_7882_monte_carlo_std_residual(self):
+        """Implementation of Task #7882 U{https://gna.org/task/?7882}: 
Implement Monte-Carlo simulation, where errors are generated with width of 
standard deviation or residuals"""
+
+        # First check that results are stored with minimisation, to make sure 
that Sum of Squares are stored (Chi2 without weighting) and degrees of freedom 
(dof) is stored.
+
+        # Load the results file from a clustered minimisation.
+        file_name = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'error_testing'+sep+'task_7882'
+        self.interpreter.results.read(file_name)
+
+        # Recalc the values at this step, to make sure that Sum of Squares are 
stored (Chi2 without weighting) and standard deviation is stored.
+        self.interpreter.minimise.execute(min_algor='simplex', func_tol=1e-05, 
max_iter=10, verbosity=0)
+
+        # Make sure they are stored for all spins.
+        for spin, spin_id in spin_loop(return_id=True, skip_desel=True):
+            self.assert_(hasattr(spin, 'sos'))
+            self.assert_(hasattr(spin, 'sos_std'))
+
+        # Then check the results are stored after a call to calculate function.
+        # First reset.
+        self.interpreter.reset()
+
+        # Run the setup function to create pipe.
+        self.setUp()
+        
+        # Load the results file from a clustered minimisation.
+        file_name = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'error_testing'+sep+'task_7882'
+        self.interpreter.results.read(file_name)
+
+        # Recalc the values at this step, to make sure that Sum of Squares are 
stored (Chi2 without weighting) and standard deviation (dof) is stored.
+        self.interpreter.minimise.calculate(verbosity=1)
+
+        # Make sure they are stored for all spins.
+        for spin, spin_id in spin_loop(return_id=True, skip_desel=True):
+            self.assert_(hasattr(spin, 'sos'))
+            self.assert_(hasattr(spin, 'sos_std'))
+
+        # Get the spins, which was used for clustering.
+        spins_cluster = cdp.clustering['sel']
+        spins_free = cdp.clustering['free spins']
+
+
     def test_tp02_data_to_tp02(self):
         """Test the relaxation dispersion 'TP02' model curve fitting to fixed 
time synthetic data."""
 


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
[email protected]

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

Reply via email to