mailr14849 - /1.3/maths_fns/n_state_model.py


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

Header


Content

Posted by edward on October 12, 2011 - 17:40:
Author: bugman
Date: Wed Oct 12 17:40:47 2011
New Revision: 14849

URL: http://svn.gna.org/viewcvs/relax?rev=14849&view=rev
Log:
Yet another fix for the N-state model target functions.

The Ln3+ optimisation with the tensors fixed was resulting in a chi2 value of 
0 at all times!


Modified:
    1.3/maths_fns/n_state_model.py

Modified: 1.3/maths_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/maths_fns/n_state_model.py?rev=14849&r1=14848&r2=14849&view=diff
==============================================================================
--- 1.3/maths_fns/n_state_model.py (original)
+++ 1.3/maths_fns/n_state_model.py Wed Oct 12 17:40:47 2011
@@ -633,6 +633,7 @@
             # Create tensor i from the parameters.
             if not self.fixed_tensors[i]:
                 to_tensor(self.A[i], params[5*index:5*index + 5])
+                index += 1
 
             # Loop over the spin systems j.
             for j in xrange(self.num_spins):
@@ -648,10 +649,6 @@
                     if not self.missing_deltaij[i, j]:
                         self.deltaij_theta[i, j] = 
ave_pcs_tensor(self.pcs_const[i, j], self.paramag_unit_vect[j], self.N, 
self.A[i], weights=self.probs)
 
-            # Skip the rest if the tensor is fixed.
-            if self.fixed_tensors[i]:
-                continue
-
             # Calculate and sum the single alignment chi-squared value (for 
the RDC).
             if self.rdc_flag:
                 chi2_sum = chi2_sum + chi2(self.Dij[i], self.Dij_theta[i], 
self.rdc_sigma_ij[i])
@@ -659,9 +656,6 @@
             # Calculate and sum the single alignment chi-squared value (for 
the PCS).
             if self.pcs_flag:
                 chi2_sum = chi2_sum + chi2(self.deltaij[i], 
self.deltaij_theta[i], self.pcs_sigma_ij[i])
-
-            # Increment the index.
-            index += 1
 
         # Return the chi-squared value.
         return chi2_sum
@@ -834,6 +828,7 @@
             # Create tensor i from the parameters.
             if not self.fixed_tensors[i]:
                 to_tensor(self.A[i], params[5*index:5*index + 5])
+                index += 1
 
             # Loop over the spin systems j.
             for j in xrange(self.num_spins):
@@ -849,10 +844,6 @@
                     if not self.missing_deltaij[i, j]:
                         self.deltaij_theta[i, j] = 
ave_pcs_tensor(self.pcs_const[i, j], self.paramag_unit_vect[j], self.N, 
self.A[i], weights=self.probs)
 
-            # Skip the rest if the tensor is fixed.
-            if self.fixed_tensors[i]:
-                continue
-
             # Calculate and sum the single alignment chi-squared value (for 
the RDC).
             if self.rdc_flag:
                 chi2_sum = chi2_sum + chi2(self.Dij[i], self.Dij_theta[i], 
self.rdc_sigma_ij[i])
@@ -860,9 +851,6 @@
             # Calculate and sum the single alignment chi-squared value (for 
the PCS).
             if self.pcs_flag:
                 chi2_sum = chi2_sum + chi2(self.deltaij[i], 
self.deltaij_theta[i], self.pcs_sigma_ij[i])
-
-            # Increment the index.
-            index += 1
 
         # Return the chi-squared value.
         return chi2_sum




Related Messages


Powered by MHonArc, Updated Wed Oct 12 18:00:02 2011