mailr19883 - /branches/relax_disp/auto_analyses/relax_disp.py


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

Header


Content

Posted by edward on June 06, 2013 - 11:50:
Author: bugman
Date: Thu Jun  6 11:50:42 2013
New Revision: 19883

URL: http://svn.gna.org/viewcvs/relax?rev=19883&view=rev
Log:
The model selection technique can now be changed in the dispersion 
auto-analysis.


Modified:
    branches/relax_disp/auto_analyses/relax_disp.py

Modified: branches/relax_disp/auto_analyses/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/auto_analyses/relax_disp.py?rev=19883&r1=19882&r2=19883&view=diff
==============================================================================
--- branches/relax_disp/auto_analyses/relax_disp.py (original)
+++ branches/relax_disp/auto_analyses/relax_disp.py Thu Jun  6 11:50:42 2013
@@ -43,7 +43,7 @@
     opt_func_tol = 1e-25
     opt_max_iterations = int(1e7)
 
-    def __init__(self, pipe_name=None, pipe_bundle=None, results_dir=None, 
models=[MODEL_R2EFF], grid_inc=11, mc_sim_num=500, bootstrap_sim_num=100000):
+    def __init__(self, pipe_name=None, pipe_bundle=None, results_dir=None, 
models=[MODEL_R2EFF], grid_inc=11, mc_sim_num=500, bootstrap_sim_num=100000, 
modsel='AIC'):
         """Perform a full relaxation dispersion analysis for the given list 
of models.
 
         @keyword pipe_name:         The name of the data pipe containing all 
of the data for the analysis.
@@ -60,6 +60,8 @@
         @type mc_sim_num:           int
         @keyword bootstrap_sim_num: The number of Monte Carlo simulations to 
be used for error analysis at the end of the analysis.
         @type bootstrap_sim_num:    int
+        @keyword modsel:            The model selection technique to use in 
the analysis to determine which model is the best for each spin cluster.  
This can currently be one of 'AIC', 'AICc', and 'BIC'.
+        @type modsel:               str
         """
 
         # Printout.
@@ -80,6 +82,7 @@
         self.grid_inc = grid_inc
         self.mc_sim_num = mc_sim_num
         self.bootstrap_sim_num = bootstrap_sim_num
+        self.modsel = modsel
 
         # No results directory, so default to the current directory.
         if not self.results_dir:
@@ -108,6 +111,11 @@
         # The pipe name.
         if not has_pipe(self.pipe_name):
             raise RelaxNoPipeError(self.pipe_name)
+
+        # Check the model selection.
+        allowed = ['AIC', 'AICc', 'BIC']
+        if self.modsel not in allowed:
+            raise RelaxError("The model selection technique '%s' is not in 
the allowed list of %s." % (self.modsel, allowed))
 
 
     def error_analysis(self):
@@ -192,7 +200,7 @@
             self.write_results(path=self.results_dir+sep+model)
 
         # Perform model selection.
-        self.interpreter.model_selection(method='AIC', modsel_pipe='final', 
pipes=model_pipes)
+        self.interpreter.model_selection(method=self.modsel, 
modsel_pipe='final', pipes=model_pipes)
 
         # Write out the final results.
         self.write_results(path=self.results_dir+sep+'final')




Related Messages


Powered by MHonArc, Updated Thu Jun 06 12:00:02 2013