Esempio n. 1
0
 def covariance_matrix(self,
                       jacobian_transpose=None,
                       normalised_by_goof=True):
   """ The columns of the jacobian_transpose determine which crystallographic
       parameters appear in the covariance matrix.
       If jacobian_transpose is None, then the covariance matrix returned will
       be that for the independent L.S. parameters.
   """
   if not self.step_equations().solved:
     self.solve()
   cov = linalg.inverse_of_u_transpose_u(
     self.step_equations().cholesky_factor_packed_u())
   cov /= self.sum_w_yo_sq()
   if jacobian_transpose is not None:
     cov = jacobian_transpose.self_transpose_times_symmetric_times_self(cov)
   if normalised_by_goof: cov *= self.restrained_goof()**2
   return cov
Esempio n. 2
0
 def covariance_matrix(self,
                       jacobian_transpose=None,
                       normalised_by_goof=True):
   """ The columns of the jacobian_transpose determine which crystallographic
       parameters appear in the covariance matrix.
       If jacobian_transpose is None, then the covariance matrix returned will
       be that for the independent L.S. parameters.
   """
   if not self.step_equations().solved:
     self.solve()
   cov = linalg.inverse_of_u_transpose_u(
     self.step_equations().cholesky_factor_packed_u())
   cov /= self.sum_w_yo_sq()
   if jacobian_transpose is not None:
     cov = jacobian_transpose.self_transpose_times_symmetric_times_self(cov)
   if normalised_by_goof: cov *= self.restrained_goof()**2
   return cov